mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-27 09:38:57 +00:00
ld: Move note sections after .rodata section
Move note sections after .rodata section so that note sections are placed in the same PT_LOAD segment together with .rodata section, instead of a separate PT_LOAD segment. PR ld/32341 * scripttempl/misc-sections.sc: Move note sections to ... * scripttempl/elf.sc: Here, after .rodata section. * testsuite/ld-elf/pr32341.d: New file. * testsuite/ld-elf/pr32341.s: Likewise. Co-Authored-By: Nick Clifton <nickc@redhat.com> Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
This commit is contained in:
@@ -668,6 +668,17 @@ cat <<EOF
|
||||
.exception_ranges ${RELOCATING-0} : ONLY_IF_RO { *(.exception_ranges${RELOCATING+*}) }
|
||||
${TEXT_PLT+${PLT_NEXT_DATA+${PLT} ${OTHER_PLT_SECTIONS}}}
|
||||
|
||||
/* Various note sections. Placed here so that they are included in the
|
||||
read-only segment, and so that they are not treated as orphan sections. */
|
||||
.note.build-id : { *(.note.build-id) } ${RELOCATING+${REGION}}
|
||||
.note.GNU-stack : { *(.note.GNU-stack) } ${RELOCATING+${REGION}}
|
||||
.note.gnu-property : { *(.note.gnu-property) } ${RELOCATING+${REGION}}
|
||||
.note.ABI-tag : { *(.note.ABI-tag) } ${RELOCATING+${REGION}}
|
||||
.note.package : { *(.note.package) } ${RELOCATING+${REGION}}
|
||||
.note.dlopen : { *(.note.dlopen) } ${RELOCATING+${REGION}}
|
||||
.note.netbsd.ident : { *(.note.netbsd.ident) } ${RELOCATING+${REGION}}
|
||||
.note.openbsd.ident : { *(.note.openbsd.ident) } ${RELOCATING+${REGION}}
|
||||
|
||||
${RELOCATING+${ETEXT_LAST_IN_RODATA_SEGMENT+PROVIDE (__${ETEXT_NAME} = .);}}
|
||||
${RELOCATING+${ETEXT_LAST_IN_RODATA_SEGMENT+PROVIDE (_${ETEXT_NAME} = .);}}
|
||||
${RELOCATING+${ETEXT_LAST_IN_RODATA_SEGMENT+PROVIDE (${ETEXT_NAME} = .);}}
|
||||
|
||||
@@ -30,15 +30,4 @@ cat <<EOF
|
||||
|
||||
.gnu.build.attributes : { *(.gnu.build.attributes${RELOCATING+ .gnu.build.attributes.*}) }
|
||||
|
||||
/* Various note sections. Placed here so that they do not get
|
||||
treated as orphan sections. */
|
||||
.note.build-id : { *(.note.build-id) } ${RELOCATING+${REGION}}
|
||||
.note.GNU-stack : { *(.note.GNU-stack) } ${RELOCATING+${REGION}}
|
||||
.note.gnu-property : { *(.note.gnu-property) } ${RELOCATING+${REGION}}
|
||||
.note.ABI-tag : { *(.note.ABI-tag) } ${RELOCATING+${REGION}}
|
||||
.note.package : { *(.note.package) } ${RELOCATING+${REGION}}
|
||||
.note.dlopen : { *(.note.dlopen) } ${RELOCATING+${REGION}}
|
||||
.note.netbsd.ident : { *(.note.netbsd.ident) } ${RELOCATING+${REGION}}
|
||||
.note.openbsd.ident : { *(.note.openbsd.ident) } ${RELOCATING+${REGION}}
|
||||
|
||||
EOF
|
||||
|
||||
Reference in New Issue
Block a user