system76-edk2/BaseTools/Scripts/gcc4.9-ld-script
Ard Biesheuvel c28a4ab663 BaseTools IA32/X64: get header size and alignment from ld commandline
Instead of hardcoding the values for the PE/COFF header size and the
section alignment, set them on the linker command line. This factors
out these values from the various linker scripts, which will allow us
to unify them in a subsequent patch.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18134 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-03 08:22:16 +00:00

39 lines
736 B
Plaintext

/* OUTPUT_FORMAT(efi-bsdrv-x86_64) */
SECTIONS
{
/* . = 0 + SIZEOF_HEADERS; */
. = PECOFF_HEADER_SIZE;
.text ALIGN(CONSTANT(COMMONPAGESIZE)) :
{
*(.text .stub .text.* .gnu.linkonce.t.*)
*(.rodata .rodata.* .gnu.linkonce.r.*)
*(.got .got.*)
}
.data ALIGN(CONSTANT(COMMONPAGESIZE)) :
{
*(
.data .data.* .gnu.linkonce.d.*
.bss .bss.*
*COM*
)
}
.eh_frame ALIGN(CONSTANT(COMMONPAGESIZE)) :
{
KEEP (*(.eh_frame))
}
.rela ALIGN(CONSTANT(COMMONPAGESIZE)) :
{
*(.rela .rela.*)
}
/DISCARD/ : {
*(.note.GNU-stack) *(.gnu_debuglink)
*(.interp)
*(.dynsym)
*(.dynstr)
*(.dynamic)
*(.hash)
*(.comment)
}
}