aboutsummaryrefslogtreecommitdiff
path: root/ldscripts
diff options
context:
space:
mode:
authorNishanth Aravamudan <nacc@us.ibm.com>2007-04-12 10:42:18 -0700
committerNishanth Aravamudan <nacc@us.ibm.com>2007-04-18 13:47:39 -0700
commite36489abb265da613882ecfa13b819aa9db4d2a3 (patch)
tree2fed83329f7ea0409f2220ceb44fca99a461302b /ldscripts
parent1bbd843dad40e1b8e3f189ef8add16adfff061e3 (diff)
downloadlibhugetlbfs-e36489abb265da613882ecfa13b819aa9db4d2a3.tar.gz
elflink: rework plt detection
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>
Diffstat (limited to 'ldscripts')
-rw-r--r--ldscripts/elf32ppclinux.xBDT8
-rw-r--r--ldscripts/elf64ppc.xBDT8
2 files changed, 10 insertions, 6 deletions
diff --git a/ldscripts/elf32ppclinux.xBDT b/ldscripts/elf32ppclinux.xBDT
index f30bd3b..109d556 100644
--- a/ldscripts/elf32ppclinux.xBDT
+++ b/ldscripts/elf32ppclinux.xBDT
@@ -161,9 +161,11 @@ SECTIONS
.dynamic : { *(.dynamic) } :dynamic :hdata
.got : { *(.got.plt .got) } :hdata
/* . = DATA_SEGMENT_RELRO_END (0, .); */
- /* Ensure the plt appears in the on-disk portion of the binary so it
- * will be copied during hugetlb remapping */
- .plt : { *(.plt) LONG(0) } :hdata
+ .plt : { *(.plt) } :hdata
+ /* Rather than emit LONG(0) in the .plt section, use a symbol to mark
+ * the end of the need-to-copy data so that it will be copied during
+ * hugetlb remapping */
+ __libhuge_filesz = .;
.data :
{
*(.data .data.* .gnu.linkonce.d.*)
diff --git a/ldscripts/elf64ppc.xBDT b/ldscripts/elf64ppc.xBDT
index 68abf09..548b707 100644
--- a/ldscripts/elf64ppc.xBDT
+++ b/ldscripts/elf64ppc.xBDT
@@ -179,9 +179,11 @@ SECTIONS
*(.sbss .sbss.* .gnu.linkonce.sb.*)
*(.scommon)
} :hdata
- /* Ensure the plt appears in the on-disk portion of the binary so it
- * will be copied during hugetlb remapping */
- .plt : { LONG(0) *(.plt) } :hdata
+ .plt : { *(.plt) } :hdata
+ /* Rather than emit LONG(0) in the .plt section, use a symbol to mark
+ * the end of the need-to-copy data so that it will be copied during
+ * hugetlb remapping */
+ __libhuge_filesz = .;
.bss :
{
*(.dynbss)