path: root/ldscripts
AgeCommit message (Collapse)Author
2008-11-25Update SECTIONS from linker scripts for binutils 2.19 compatibility2.1-pre5Eric B Munson
When building the linker script tests on SLES 11, the resulting executable had an invalid size for the interp section. This is dues to a new section that was not present in the old script. This patch adds this section to all of the linker scripts. Credit goes to Alan Modra for identifying what change needed to be made Signed-off-by: Eric B Munson <ebmunson@us.ibm.com> Acked-by: Adam Litke <agl@us.ibm.com>
2008-10-21whitespace: cleanup whitespace breakage2.1-pre3Andy Whitcroft
We have developed a far amount of whitespace damage over time. Do a one off cleanup of all of the breakage now. Signed-off-by: Andy Whitcroft <apw@shadowen.org> Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
2008-03-07ldscripts: Remove unneeded __libhuge_filesz symbolAdam Litke
The previous patch eliminated the need for __libhuge_filesz in linker scripts. Remove it. Signed-off-by: Adam Litke <agl@us.ibm.com> Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
2008-01-30elf64ppc.xB flexible BSS alignmentAdam Litke
glibc makes certain assumptions about the layout of the text, data, and bss segments of shared objects and executables. One of those assumptions is that all segments of an objects will be mapped consecutively. The current elf64ppc.xB linker script unconditionally begins the BSS at 1.5T which virtually guarantees that something will be mapped between the data segment and bss of the executable. This breaks the consecutive mapping assumption and can cause application failures. In many cases, the text, data, and bss can all fit below 4G. In this case, BSS alignment can be reduced to 256M and executable segments can be mapped much closer together. This patch contains a conditional ALIGN statement so the case of a data segment extending beyond 4G can be handled. This patch resolves the dlopen problems we have been seeing lately with some benchmark suites. Signed-off-by: Adam Litke <agl@us.ibm.com> Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
2007-11-30ldscripts: Place 32bit BDT PLT in BSS for PPCNishanth Aravamudan
The PLT belongs in the BSS and the standard scripts do it this way. We were getting bad BSS padding for programs with a large BSS. Signed-off-by: Steve Fox <drfickle@linux.vnet.ibm.com> Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
2007-11-30ldscripts: standardize BDT phdr namingNishanth Aravamudan
Currently, elf_i386.xBDT and elf_x86_64.xBDT use a different naming scheme for the huge text and huge data program headers, compared to the ppc scripts. Adding other scripts is made more difficult (at least for me) by this difference, so make them all use htext for huge text and hdata for huge data. Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Acked-by: David Gibson <david@gibson.dropbear.id.au>
2007-07-02elf64ppc.B: fix eh_frame_hdr placement be with the text not dataNishanth Aravamudan
For some reason, I made the ppc64 B-only linker script place the eh_frame_hdr with the data, while every other arch placed it with the text. This led to segfault of bwaves from SPECCPU in the B-only 64-bit configuration. Fix this by placing the eh_frame_hdr in the text like all the other scripts. 64-bit B-only bwaves completes successfully with this patch applied. Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Acked-by: David Gibson <david@gibson.dropbear.id.au>
2007-04-19ldscripts: fix EH_FRAME segmentNishanth Aravamudan
We currently place the eh_frame_hdr section in the data segment near the eh_frame section. However, non-relinked binaries have a GNU_EH_FRAME segment which only contains this section. Fix this by putting the .eh_frame_hdr section in both the data (or text, as appopriate) segment and the eh_frame_hdr segment. The eh_frame_hdr segment, unfortunately, is not easily definable, so we have to use a constant (found by Adam) to add it to each linker script (the constant is defined in /usr/include/elf.h). Add some comments to indicate the lack of the constant's definition. Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Signed-off-by: Adam Litke <agl@us.ibm.com>
2007-04-18elflink: rework plt detectionNishanth Aravamudan
We currently emit LONG(0) into the .plt section to make it appear in the filesz (on-disk) portion of the data/bss segment. This is a problem, however, for powerpc64, where the ABI specifies that the .plt section is NOBITS (x86 and x86_64 mark the .plt PROGBITS). Given that the program is being relinked to begin with, however, it seems logical to simply add a tag, similar to __executable_start, to make finding the "libhuge" filesz easy to find. Do exactly this, via __libhuge_filesz. We continue to use the extracopy algorithm, but move the extracopy end out to __libhuge_filesz if it is after the detected end. Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Acked-by: Adam Litke <agl@us.ibm.com>
2006-11-06ldscripts: Fix .note.SuSE and .note.ABI-tag sectionsaglitke
Since we are explicitly placing things into output segments, we must include placement information for .note.SuSE and .note.ABI-tag sections. Otherwise, they can be incorrectly placed in the .interp segment, which makes an un-runnable binary. Signed-off-by: Steve Fox <drfickle@us.ibm.com>
2006-10-26ldscripts: Missing bss section placement statementaglitke
This appears to be a longstanding bug in the ppc32 .xB linker script. When the BSS was moved into its own htlb segment, we lost the explicit placement of the .bss* and .gnu.linkouce.b.* sections. Default ld behavior was placing them implicitly in the htlb segment anyway so we didn't notice the problem until commit c3f4d10a80d6ad8bb37ef6f80e70c3c7d778117a "ldscripts: [powerpc] Align the end of the BSS to a segment boundary". After this change, the implicit behavior was to place the ommitted sections after the 256M alignment (which defeats the purpose of the ALIGN in the first place). The default system linker scripts (on SLES10 at least) contain the line added by this patch, which further supports my case that it should be there. Signed-off-by: Adam Litke <agl@us.ibm.com>
2006-10-03ldscripts: [powerpc] Align the end of the BSS to a segment boundaryaglitke
Since powerpc has special limitations which permit only one page size per 256M block of virtual address space, the linker scripts must be modified to guard against a few corner cases. If ld.so decides to map a library or any other memory object in the same segment as the BSS, we will be unable to remap the BSS into huge pages. The fix is to align the end of the BSS to a 256M boundary. This essentially reserves the entire segment for use by the BSS (and other huge page allocations in the future). Signed-off-by: Adam Litke <agl@us.ibm.com>
2006-03-21Oops, Pad the end of the plt with LONG(0).aglitke
2006-03-13Updates to i386 linker scriptsaglitke
1) Merge .got.plt into the .got section 2) Comment out ONLY_IF_* and RELRO constructs to be compatible with older versions of binutils.
2006-03-13copy only p_filesz bytes from original segment into huge pagesaglitke
For ELF segments with a significantly large area of uninitialized data (memsz is much larger than filesz) it is incredibly inefficient to copy data beyond filesz bytes since it should be all zeroes anyway. Making this optimization requires small changes to the linker scripts that remap the data segment into huge pages. The plt section must be padded with a piece of static data to force it into the filesz (on-disk) portion of the executable. This ensures the plt actually gets copied during remapping.
2006-02-10Adjust 64-bit ppc linker script to use 1.5TB for BSS instead of 1TB, soDavid Gibson
that programs linked with it can work (albeit without hugepage) on old kernels with the fixed 1-1.5TB hugepage range.
2006-01-17Add handling of .note.SuSE section to ldscripts.David Gibson
2006-01-16Correct handling of .note.ABI-tag section in linker scripts.David Gibson
2006-01-09Added copyright notices and LGPL invocation.1.0-pre1David Gibson
2006-01-06Don't use PROVIDE() to define __executable_start since it can result in theDavid Gibson
symbol not getting exported by the linker on some versions of binutils. Patch from Adam Litke <agl@us.ibm.com>
2005-12-19Remove recent ld features from linker scripts, aiming to have them work onDavid Gibson
the SLES9 version of binutils.
2005-12-01x86_64 linker scriptsDavid Gibson
2005-12-01Tiny tweaks (spacing, comments) to linker scripts.David Gibson
2005-12-01xBDT support for i386.David Gibson
2005-12-01Lots of work on ELF mapping stuff. Now xB and xBDT at least somewhat work.David Gibson
2005-11-29New important testcases, further work on automatic segment mapping.David Gibson
2005-11-28Automatic BSS in hugepage support for x86David Gibson
2005-11-28(implicit) hugepage BSS for ppc32 and ppc64.David Gibson
2005-11-28Many updates:David Gibson
- Basically working ELF segment remapping - Don't compile or run tests relevant only to 64 bit as 32 bit - Less verbose make output (similar to Kbuild) - Many warnings in testcases squashed
2005-11-25Linker scripts, and basic testcase for auto hugepage stuff.David Gibson