On 24 June 2015 at 18:05, Andrew Fish <af...@apple.com> wrote:
>
> On Jun 23, 2015, at 8:30 AM, Ard Biesheuvel <ard.biesheu...@linaro.org>
> wrote:
>
> This is an RFC series to elicit discussion regarding the use of linker
> script,
> and the fact that we use the somewhat obscure 'large' C model for building
> EDK2 for AArch64.
>
>
> Sorry I missed why the `large C` module is being used?
>
> Also what impact does it have on the ABI? For example does it impact size_t
> definition? I assume it does not change the definition of long?
>

The 'small' C model, which is the default, uses ADRP/ADD pairs to
compose PC relative symbol references using two instructions, where
the first gets the page address of the symbol, and the second the
offset into the page. This avoids having lots of literals containing
absolute addresses (that need to be relocated at runtime) but it does
require the link time and load time addresses of the instructions to
be at the same offset relative to the nearest 4 K boundary. Since EDK2
does not guarantee such alignment, the large C model is used instead.

However, when looking into the issue Eugene reported (which is related
to differences in memory layout between ELF and PE/COFF versions of
the binaries), and agreeing that we should not rely on the linker's
builtin linker script but use an explicit one instead (like we do for
GCC/X64 as well), I realized that it is an opportunity for proposing
some changes that allow the small C model to be used.

-- 
Ard.

------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical & virtual servers, alerts via email & sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to