diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2015-08-03 08:22:16 +0000 |
---|---|---|
committer | abiesheuvel <abiesheuvel@Edk2> | 2015-08-03 08:22:16 +0000 |
commit | c28a4ab663ec3019bef5316ec569c0791e40e924 (patch) | |
tree | 36cf9022d1b8b8ecf54d1d282e10cc1d395507ff /BaseTools/Scripts | |
parent | 25e63063e3a2817fd56fd47fffb11173472a15de (diff) | |
download | edk2-c28a4ab663ec3019bef5316ec569c0791e40e924.tar.gz edk2-c28a4ab663ec3019bef5316ec569c0791e40e924.tar.bz2 edk2-c28a4ab663ec3019bef5316ec569c0791e40e924.zip |
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
Diffstat (limited to 'BaseTools/Scripts')
-rw-r--r-- | BaseTools/Scripts/gcc-4K-align-ld-script | 10 | ||||
-rw-r--r-- | BaseTools/Scripts/gcc4.4-ld-script | 10 | ||||
-rw-r--r-- | BaseTools/Scripts/gcc4.9-ld-script | 10 |
3 files changed, 15 insertions, 15 deletions
diff --git a/BaseTools/Scripts/gcc-4K-align-ld-script b/BaseTools/Scripts/gcc-4K-align-ld-script index 34957a5314..51daae04d8 100644 --- a/BaseTools/Scripts/gcc-4K-align-ld-script +++ b/BaseTools/Scripts/gcc-4K-align-ld-script @@ -2,14 +2,14 @@ SECTIONS
{
/* . = 0 + SIZEOF_HEADERS; */
- . = 0x280;
- .text : ALIGN(0x1000)
+ . = PECOFF_HEADER_SIZE;
+ .text : ALIGN(CONSTANT(COMMONPAGESIZE))
{
*(.text .stub .text.* .gnu.linkonce.t.*)
*(.rodata .rodata.* .gnu.linkonce.r.*)
*(.got .got.*)
}
- .data : ALIGN(0x1000)
+ .data : ALIGN(CONSTANT(COMMONPAGESIZE))
{
*(
.data .data.* .gnu.linkonce.d.*
@@ -17,11 +17,11 @@ SECTIONS *COM*
)
}
- .eh_frame : ALIGN(0x1000)
+ .eh_frame : ALIGN(CONSTANT(COMMONPAGESIZE))
{
KEEP (*(.eh_frame))
}
- .rela : ALIGN(0x1000)
+ .rela : ALIGN(CONSTANT(COMMONPAGESIZE))
{
*(.rela .rela.*)
}
diff --git a/BaseTools/Scripts/gcc4.4-ld-script b/BaseTools/Scripts/gcc4.4-ld-script index 48320c6611..ebb2e1d1b7 100644 --- a/BaseTools/Scripts/gcc4.4-ld-script +++ b/BaseTools/Scripts/gcc4.4-ld-script @@ -2,14 +2,14 @@ SECTIONS
{
/* . = 0 + SIZEOF_HEADERS; */
- . = 0x280;
- .text ALIGN(0x20) :
+ . = PECOFF_HEADER_SIZE;
+ .text ALIGN(CONSTANT(COMMONPAGESIZE)) :
{
*(.text .stub .text.* .gnu.linkonce.t.*)
*(.rodata .rodata.* .gnu.linkonce.r.*)
*(.got .got.*)
}
- .data ALIGN(0x20) :
+ .data ALIGN(CONSTANT(COMMONPAGESIZE)) :
{
*(
.data .data.* .gnu.linkonce.d.*
@@ -17,11 +17,11 @@ SECTIONS *COM*
)
}
- .eh_frame ALIGN(0x20) :
+ .eh_frame ALIGN(CONSTANT(COMMONPAGESIZE)) :
{
KEEP (*(.eh_frame))
}
- .rela ALIGN(0x20) :
+ .rela ALIGN(CONSTANT(COMMONPAGESIZE)) :
{
*(.rela .rela.*)
}
diff --git a/BaseTools/Scripts/gcc4.9-ld-script b/BaseTools/Scripts/gcc4.9-ld-script index 3dff0b2907..ebb2e1d1b7 100644 --- a/BaseTools/Scripts/gcc4.9-ld-script +++ b/BaseTools/Scripts/gcc4.9-ld-script @@ -2,14 +2,14 @@ SECTIONS
{
/* . = 0 + SIZEOF_HEADERS; */
- . = 0x280;
- .text ALIGN(0x20) :
+ . = PECOFF_HEADER_SIZE;
+ .text ALIGN(CONSTANT(COMMONPAGESIZE)) :
{
*(.text .stub .text.* .gnu.linkonce.t.*)
*(.rodata .rodata.* .gnu.linkonce.r.*)
*(.got .got.*)
}
- .data ALIGN(0x40) :
+ .data ALIGN(CONSTANT(COMMONPAGESIZE)) :
{
*(
.data .data.* .gnu.linkonce.d.*
@@ -17,11 +17,11 @@ SECTIONS *COM*
)
}
- .eh_frame ALIGN(0x20) :
+ .eh_frame ALIGN(CONSTANT(COMMONPAGESIZE)) :
{
KEEP (*(.eh_frame))
}
- .rela ALIGN(0x20) :
+ .rela ALIGN(CONSTANT(COMMONPAGESIZE)) :
{
*(.rela .rela.*)
}
|