PATCH: Move .gnu.version* out of loadable segment in BPABI
Mark Mitchell
mark@codesourcery.com
Mon Oct 11 05:23:00 GMT 2004
The various .gnu.version* sections are not loadable under the ARM
BPABI; like .hash, etc., these sections are processed by the post
linker, but not form part of the loadable image.
OK?
--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
2004-10-10 Mark Mitchell <mark@codesourcery.com>
* elf32-arm.h (elf32_arm_finish_dynamic_sections): Use file
offsets, not VMAs, for DT_VERSYM, DT_VERDEF, DT_VERNEED.
2004-10-10 Mark Mitchell <mark@codesourcery.com>
* scripttempl/armbpabi.sc: Do not put .gnu.version.* into a
loadable segment.
Index: bfd/elf32-arm.h
===================================================================
RCS file: /cvs/src/src/bfd/elf32-arm.h,v
retrieving revision 1.139
diff -c -5 -p -r1.139 elf32-arm.h
*** bfd/elf32-arm.h 6 Sep 2004 20:55:22 -0000 1.139
--- bfd/elf32-arm.h 11 Oct 2004 05:16:13 -0000
*************** elf32_arm_finish_dynamic_sections (bfd *
*** 3899,3909 ****
name = ".dynstr";
goto get_vma_if_bpabi;
case DT_SYMTAB:
name = ".dynsym";
goto get_vma_if_bpabi;
!
case DT_PLTGOT:
name = ".got";
goto get_vma;
case DT_JMPREL:
name = ".rel.plt";
--- 3899,3918 ----
name = ".dynstr";
goto get_vma_if_bpabi;
case DT_SYMTAB:
name = ".dynsym";
goto get_vma_if_bpabi;
! case DT_VERSYM:
! name = ".gnu.version";
! goto get_vma_if_bpabi;
! case DT_VERDEF:
! name = ".gnu.version_d";
! goto get_vma_if_bpabi;
! case DT_VERNEED:
! name = ".gnu.version_r";
! goto get_vma_if_bpabi;
!
case DT_PLTGOT:
name = ".got";
goto get_vma;
case DT_JMPREL:
name = ".rel.plt";
Index: ld/scripttempl/armbpabi.sc
===================================================================
RCS file: /cvs/src/src/ld/scripttempl/armbpabi.sc,v
retrieving revision 1.1
diff -c -5 -p -r1.1 armbpabi.sc
*** ld/scripttempl/armbpabi.sc 6 Sep 2004 20:55:23 -0000 1.1
--- ld/scripttempl/armbpabi.sc 11 Oct 2004 05:16:33 -0000
*************** SECTIONS
*** 203,215 ****
/* Read-only sections, merged into text segment: */
${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+PROVIDE (__executable_start = ${TEXT_START_ADDR}); . = ${TEXT_BASE_ADDRESS};}}}
${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR:-0} + SIZEOF_HEADERS;}}
${CREATE_PIE+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR:-0} + SIZEOF_HEADERS;}}
${INITIAL_READONLY_SECTIONS}
- .gnu.version ${RELOCATING-0} : { *(.gnu.version) }
- .gnu.version_d ${RELOCATING-0}: { *(.gnu.version_d) }
- .gnu.version_r ${RELOCATING-0}: { *(.gnu.version_r) }
EOF
if [ "x$COMBRELOC" = x ]; then
COMBRELOCCAT=cat
else
--- 203,212 ----
*************** cat <<EOF
*** 382,391 ****
--- 379,391 ----
/* These sections are not mapped under the BPABI. */
.dynamic 0 : { *(.dynamic) }
.hash 0 : { *(.hash) }
.dynsym 0 : { *(.dynsym) }
.dynstr 0 : { *(.dynstr) }
+ .gnu.version 0 : { *(.gnu.version) }
+ .gnu.version_d 0: { *(.gnu.version_d) }
+ .gnu.version_r 0: { *(.gnu.version_r) }
${CREATE_SHLIB-${INTERP}}
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
More information about the Binutils
mailing list