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
- To: Jim Wilson <wilson at cygnus dot com>
- Subject: Re: IA-64 gp problem with PROVIDE and linker relaxation conflict
- From: Alan Modra <alan at linuxcare dot com dot au>
- Date: Tue, 13 Feb 2001 20:55:55 +1100 (EST)
- cc: binutils at sources dot redhat dot com
On Tue, 13 Feb 2001, Alan Modra wrote:
> Ah, hmm. Fairly obvious lack of setting h->root.type, value etc. in
> elf32-hppa.c:elf32_hppa_set_gp. Thanks! This discussion has led to a
> code improvement.
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.
bfd/ChangeLog
* elf32-hppa.c (elf32_hppa_set_gp): Handle weak $global$. If
$global$ referenced but not defined, set its value here.
Alan Modra
--
Linuxcare. Support for the Revolution.
Index: elf32-hppa.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-hppa.c,v
retrieving revision 1.25
diff -u -p -r1.25 elf32-hppa.c
--- elf32-hppa.c 2001/01/14 11:12:52 1.25
+++ elf32-hppa.c 2001/02/13 09:48:03
@@ -3024,7 +3024,9 @@ elf32_hppa_set_gp (abfd, info)
h = elf_link_hash_lookup (&hplink->root, "$global$",
false, false, false);
- if (h != NULL && h->root.type == bfd_link_hash_defined)
+ if (h != NULL
+ && (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak))
{
gp_val = h->root.u.def.value;
sec = h->root.u.def.section;
@@ -3066,6 +3068,16 @@ elf32_hppa_set_gp (abfd, info)
/* No .plt or .got. Who cares what the LTP is? */
sec = bfd_get_section_by_name (abfd, ".data");
}
+ }
+
+ if (h != NULL)
+ {
+ h->root.type = bfd_link_hash_defined;
+ h->root.u.def.value = gp_val;
+ if (sec != NULL)
+ h->root.u.def.section = sec;
+ else
+ h->root.u.def.section = bfd_abs_section_ptr;
}
}