This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix -pie on IA-64


Hi!

PIEs don't work at all in binutils CVS since November.  The problem is
that linker script puts RELA section in wrong order:
.rela.dyn
.rela.IA_64.pltoff
.rela.opd
while it of course should be
.rela.dyn (where .rela.opd is included here)
.rela.IA_64.pltoff
On IA-64, DT_RELA..DT_RELA+DT_RELASZ covers all allocated .rela sections
(correct), but if .rela.IA_64.pltoff is in the middle (and thus
DT_JMPREL..DT_JMPREL+DT_PLTRELSZ), the dynamic linker is certainly not
able to cope with it (and relocates .rela.IA_64.pltoff relocs twice,
first time as in non-lazy binding and second time adds l_addr to it
as in preparation for lazy binding).
Ok to commit?

2004-01-23  Jakub Jelinek  <jakub@redhat.com>

	* emulparams/elf64_ia64.sh: Put .rela.opd into
	OTHER_GOT_RELOC_SECTIONS instead of OTHER_PLT_RELOC_SECTIONS.

--- ld/emulparams/elf64_ia64.sh.jj	2003-12-02 15:39:03.000000000 +0100
+++ ld/emulparams/elf64_ia64.sh	2004-01-22 22:29:51.000000000 +0100
@@ -28,7 +28,7 @@ test -z "$CREATE_PIE" && OTHER_READONLY_
   .opd          ${RELOCATING-0} : { *(.opd) }"
 test -n "$CREATE_PIE" && OTHER_READWRITE_SECTIONS="
   .opd          ${RELOCATING-0} : { *(.opd) }"
-test -n "$CREATE_PIE" && OTHER_PLT_RELOC_SECTIONS="${OTHER_PLT_RELOC_SECTIONS}
+test -n "$CREATE_PIE" && OTHER_GOT_RELOC_SECTIONS="
   .rela.opd     ${RELOCATING-0} : { *(.rela.opd) }"
 OTHER_READONLY_SECTIONS="${OTHER_READONLY_SECTIONS}
   .IA_64.unwind_info ${RELOCATING-0} : { *(.IA_64.unwind_info${RELOCATING+* .gnu.linkonce.ia64unwi.*}) }

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]