This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: IA-64 gp problem with PROVIDE and linker relaxation conflict
On Tue, Feb 13, 2001 at 08:55:55PM +1100, Alan Modra wrote:
> I'm about to apply to following so that on hppa-linux we can remove the
> PROVIDE($global$) in the linker scripts. Jim, you'll need something
> similar for ia64.
The following appears to do the job, Jim.
r~
* elfxx-ia64.c (elfNN_ia64_final_link): Set __gp if required
and not user provided.
* emulparams/elf64_ia64.sh (OTHER_GOT_SYMBOLS): Remove.
Index: bfd/elfxx-ia64.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-ia64.c,v
retrieving revision 1.11
diff -c -p -d -r1.11 elfxx-ia64.c
*** elfxx-ia64.c 2001/02/10 01:41:06 1.11
--- elfxx-ia64.c 2001/02/13 19:03:48
*************** elfNN_ia64_final_link (abfd, info)
*** 3157,3162 ****
--- 3157,3169 ----
}
_bfd_set_gp_value (abfd, gp_val);
+
+ if (gp)
+ {
+ gp->root.type = bfd_link_hash_defined;
+ gp->root.u.def.value = gp_val;
+ gp->root.u.def.section = bfd_abs_section_ptr;
+ }
}
/* If we're producing a final executable, we need to sort the contents
Index: ld/emulparams/elf64_ia64.sh
===================================================================
RCS file: /cvs/src/src/ld/emulparams/elf64_ia64.sh,v
retrieving revision 1.3
diff -c -p -d -r1.3 elf64_ia64.sh
*** elf64_ia64.sh 2001/02/10 01:44:39 1.3
--- elf64_ia64.sh 2001/02/13 19:03:48
*************** TEXT_START_ADDR="0x4000000000000000"
*** 10,16 ****
DATA_ADDR="0x6000000000000000 + (. & (${MAXPAGESIZE} - 1))"
GENERATE_SHLIB_SCRIPT=yes
NOP=0x00300000010070000002000001000400 # a bundle full of nops
- OTHER_GOT_SYMBOLS='. = ALIGN (8); PROVIDE (__gp = . + 0x200000);'
OTHER_GOT_SECTIONS='.IA_64.pltoff : { *(.IA_64.pltoff) }'
OTHER_PLT_RELOC_SECTIONS='.rela.IA_64.pltoff : { *(.rela.IA_64.pltoff) }'
OTHER_READONLY_SECTIONS='.opd : { *(.opd) } .IA_64.unwind_info : { *(.IA_64.unwind_info*) } .IA_64.unwind : { *(.IA_64.unwind*) }'
--- 10,15 ----