summaryrefslogtreecommitdiff
path: root/bfd/elf32-hppa.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2001-02-13 10:14:14 +0000
committerAlan Modra <amodra@bigpond.net.au>2001-02-13 10:14:14 +0000
commitd03e176d6718fa690b875327ddf3da7aa0bc9f20 (patch)
tree7201aeb8bc3f8b8aa7f636a66456e21c7a22afa5 /bfd/elf32-hppa.c
parent742ee9eb3be178de53f8fb3a35e5325e7792658d (diff)
downloadgdb-d03e176d6718fa690b875327ddf3da7aa0bc9f20.tar.gz
(elf32_hppa_set_gp): Handle weak $global$.
If $global$ referenced but not defined, set its value here.
Diffstat (limited to 'bfd/elf32-hppa.c')
-rw-r--r--bfd/elf32-hppa.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index 13f1e5a37da..63071f3aeee 100644
--- a/bfd/elf32-hppa.c
+++ b/bfd/elf32-hppa.c
@@ -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;
@@ -3067,6 +3069,16 @@ elf32_hppa_set_gp (abfd, info)
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;
+ }
}
if (sec != NULL)