libhugetlbfs/libhugetlbfs.ABI-tag.patch

119 lines
5.3 KiB
Diff

ldscripts: Fix .note.SuSE and .note.ABI-tag sections
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.
tests: Fix zero_filesize_segment testcase
This testcase is implemented as a linker script which can be "compiled"
like a program. As such, the caveats with .note.ABI-tag and .note.SuSE
in our other linker scripts apply here as well. Add explicit placement
of these sections so ld's implicit guessing doesn't get it wrong.
Signed-off-by: Steve Fox <drfickle@us.ibm.com>
---
ldscripts/elf32ppclinux.xB | 2 +-
ldscripts/elf32ppclinux.xBDT | 2 +-
ldscripts/elf64ppc.xB | 2 +-
ldscripts/elf64ppc.xBDT | 2 +-
ldscripts/elf_x86_64.xB | 2 ++
ldscripts/elf_x86_64.xBDT | 2 ++
tests/zero_filesize_segment.ld | 2 ++
7 files changed, 10 insertions(+), 4 deletions(-)
Index: libhugetlbfs-1.0.1/ldscripts/elf32ppclinux.xB
===================================================================
--- libhugetlbfs-1.0.1.orig/ldscripts/elf32ppclinux.xB
+++ libhugetlbfs-1.0.1/ldscripts/elf32ppclinux.xB
@@ -21,7 +21,7 @@ SECTIONS
/* Read-only sections, merged into text segment: */
__executable_start = 0x10000000; . = 0x10000000 + SIZEOF_HEADERS;
.interp : { *(.interp) } :text :interp
- .note.SuSE : { *(.note.ABI-tag) } :text :note
+ .note.SuSE : { *(.note.SuSE) } :text :note
.note.ABI-tag : { *(.note.ABI-tag) } :text :note
.hash : { *(.hash) } :text
.dynsym : { *(.dynsym) } :text
Index: libhugetlbfs-1.0.1/ldscripts/elf32ppclinux.xBDT
===================================================================
--- libhugetlbfs-1.0.1.orig/ldscripts/elf32ppclinux.xBDT
+++ libhugetlbfs-1.0.1/ldscripts/elf32ppclinux.xBDT
@@ -20,7 +20,7 @@ SECTIONS
/* Read-only sections, merged into text segment: */
__executable_start = 0x10000000; . = 0x10000000 + SIZEOF_HEADERS;
.interp : { *(.interp) } :htext :interp
- .note.SuSE : { *(.note.ABI-tag) } :htext :note
+ .note.SuSE : { *(.note.SuSE) } :htext :note
.note.ABI-tag : { *(.note.ABI-tag) } :htext :note
.hash : { *(.hash) } :htext
.dynsym : { *(.dynsym) } :htext
Index: libhugetlbfs-1.0.1/ldscripts/elf64ppc.xB
===================================================================
--- libhugetlbfs-1.0.1.orig/ldscripts/elf64ppc.xB
+++ libhugetlbfs-1.0.1/ldscripts/elf64ppc.xB
@@ -20,7 +20,7 @@ SECTIONS
/* Read-only sections, merged into text segment: */
__executable_start = 0x10000000; . = 0x10000000 + SIZEOF_HEADERS;
.interp : { *(.interp) } :text :interp
- .note.SuSE : { *(.note.ABI-tag) } :text :note
+ .note.SuSE : { *(.note.SuSE) } :text :note
.note.ABI-tag : { *(.note.ABI-tag) } :text :note
.hash : { *(.hash) } :text
.dynsym : { *(.dynsym) }
Index: libhugetlbfs-1.0.1/ldscripts/elf64ppc.xBDT
===================================================================
--- libhugetlbfs-1.0.1.orig/ldscripts/elf64ppc.xBDT
+++ libhugetlbfs-1.0.1/ldscripts/elf64ppc.xBDT
@@ -19,7 +19,7 @@ SECTIONS
/* Read-only sections, merged into text segment: */
__executable_start = 0x10000000; . = 0x10000000 + SIZEOF_HEADERS;
.interp : { *(.interp) } :interp :htext
- .note.SuSE : { *(.note.ABI-tag) } :htext :note
+ .note.SuSE : { *(.note.SuSE) } :htext :note
.note.ABI-tag : { *(.note.ABI-tag) } :htext :note
.hash : { *(.hash) } :htext
.dynsym : { *(.dynsym) } :htext
Index: libhugetlbfs-1.0.1/ldscripts/elf_x86_64.xB
===================================================================
--- libhugetlbfs-1.0.1.orig/ldscripts/elf_x86_64.xB
+++ libhugetlbfs-1.0.1/ldscripts/elf_x86_64.xB
@@ -23,6 +23,8 @@ SECTIONS
/* Read-only sections, merged into text segment: */
__executable_start = 0x400000; . = 0x400000 + SIZEOF_HEADERS;
.interp : { *(.interp) } :text :interp
+ .note.SuSE : { *(.note.SuSE) } :text :note
+ .note.ABI-tag : { *(.note.ABI-tag) } :text :note
.hash : { *(.hash) } :text
.dynsym : { *(.dynsym) } :text
.dynstr : { *(.dynstr) } :text
Index: libhugetlbfs-1.0.1/ldscripts/elf_x86_64.xBDT
===================================================================
--- libhugetlbfs-1.0.1.orig/ldscripts/elf_x86_64.xBDT
+++ libhugetlbfs-1.0.1/ldscripts/elf_x86_64.xBDT
@@ -25,6 +25,8 @@ SECTIONS
__executable_start = 0x1000000; . = 0x1000000 + SIZEOF_HEADERS;
.interp : { *(.interp) } :interp :text
.hash : { *(.hash) } :text
+ .note.SuSE : { *(.note.SuSE) } :text :note
+ .note.ABI-tag : { *(.note.ABI-tag) } :text :note
.dynsym : { *(.dynsym) } :text
.dynstr : { *(.dynstr) } :text
.gnu.version : { *(.gnu.version) } :text
Index: libhugetlbfs-1.0.1/tests/zero_filesize_segment.ld
===================================================================
--- libhugetlbfs-1.0.1.orig/tests/zero_filesize_segment.ld
+++ libhugetlbfs-1.0.1/tests/zero_filesize_segment.ld
@@ -12,6 +12,8 @@ PHDRS
SECTIONS
{
.interp : { } :interp :text
+ .note.ABI-tag : { *(.note.ABI-tag) } :text
+ .note.SuSE : { *(.note.SuSE) } :text
.hash : { } :text
.tdata : { } :data
.dynamic : { } :dynamic :data