1. 29 Oct, 2018 3 commits
    • Soby Mathew's avatar
      PIE: Use PC relative adrp/adr for symbol reference · f1722b69
      Soby Mathew authored
      
      
      This patch fixes up the AArch64 assembly code to use
      adrp/adr instructions instead of ldr instruction for
      reference to symbols. This allows these assembly
      sequences to be Position Independant. Note that the
      the reference to sizes have been replaced with
      calculation of size at runtime. This is because size
      is a constant value and does not depend on execution
      address and using PC relative instructions for loading
      them makes them relative to execution address. Also
      we cannot use `ldr` instruction to load size as it
      generates a dynamic relocation entry which must *not*
      be fixed up and it is difficult for a dynamic loader
      to differentiate which entries need to be skipped.
      
      Change-Id: I8bf4ed5c58a9703629e5498a27624500ef40a836
      Signed-off-by: default avatarSoby Mathew <soby.mathew@arm.com>
      f1722b69
    • Soby Mathew's avatar
      Basic Makefile changes for PIE · 3bd17c0f
      Soby Mathew authored
      
      
      Change-Id: I0b8ccba15024c55bb03927cdb50370913eb8010c
      Signed-off-by: default avatarSoby Mathew <soby.mathew@arm.com>
      3bd17c0f
    • Soby Mathew's avatar
      Add helper to return reference to a symbol · 6a7b3005
      Soby Mathew authored
      
      
      This patch adds a utility function to return
      the address of a symbol. By default, the compiler
      generates adr/adrp instruction pair to return
      the reference and this utility is used to override
      this compiler generated to code and use `ldr`
      instruction.
      
      This is needed for Position Independent Executable
      when it needs to reference a symbol which is constant
      and does not depend on the execute address of the
      binary.
      
      For example, on the FVP, the GICv3 register context is
      stored in a secure carveout (arm_el3_tzc_dram) within
      DDR and does not relocate with the BL image. Now if
      BL31 is executing at a different address other than
      the compiled address, using adrp/adr instructions to
      reference this memory will not work as they generate an
      address that is PC relative. The way to get around this
      problem is to reference it as non-PC relative (i.e
      non-relocatable location) via `ldr` instruction.
      
      Change-Id: I5008a951b007144258121690afb68dc8e12ee6f7
      Signed-off-by: default avatarSoby Mathew <soby.mathew@arm.com>
      6a7b3005
  2. 26 Oct, 2018 3 commits
  3. 25 Oct, 2018 9 commits
  4. 24 Oct, 2018 5 commits
  5. 23 Oct, 2018 9 commits
  6. 19 Oct, 2018 2 commits
    • Soby Mathew's avatar
      Multi-console: Deprecate the `finish_console_register` macro · cc5859ca
      Soby Mathew authored
      
      
      The `finish_console_register` macro is used by the multi console
      framework to register the `console_t` driver callbacks. It relied
      on weak references to the `ldr` instruction to populate 0 to the
      callback in case the driver has not defined the appropriate
      function. Use of `ldr` instruction to load absolute address to a
      reference makes the binary position dependant. These instructions
      should be replaced with adrp/adr instruction for position independant
      executable(PIE). But adrp/adr instructions don't work well with weak
      references as described in GNU ld bugzilla issue 22589.
      
      This patch defines a new version of `finish_console_register` macro
      which can spcify which driver callbacks are valid and deprecates the
      old one. If any of the argument is not specified, then the macro
      populates 0 for that callback. Hence the functionality of the previous
      deprecated macro is preserved. The USE_FINISH_CONSOLE_REG_2 define
      is used to select the new variant of the macro and will be removed
      once the deprecated variant is removed.
      
      All the upstream console drivers have been migrated to use the new
      macro in this patch.
      
      NOTE: Platforms be aware that the new variant of the
      `finish_console_register` should be used and the old variant is
      deprecated.
      
      Change-Id: Ia6a67aaf2aa3ba93932992d683587bbd0ad25259
      Signed-off-by: default avatarSoby Mathew <soby.mathew@arm.com>
      cc5859ca
    • Antonio Nino Diaz's avatar
      Makefile: Fix verbose builds on Windows · b5a0f4bd
      Antonio Nino Diaz authored
      Commit <ee1ba6d4
      
      > ("Makefile: Support totally quiet output with -s")
      broke verbose (V=1) builds on Windows. This patch fixes it by adding
      helpers to silence echo prints in a OS-dependent way.
      
      Change-Id: I24669150457516e9fb34fa32fa103398efe8082d
      Signed-off-by: default avatarAntonio Nino Diaz <antonio.ninodiaz@arm.com>
      b5a0f4bd
  7. 18 Oct, 2018 9 commits