aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2001-02-13 10:14:14 +0000
committerAlan Modra <amodra@gmail.com>2001-02-13 10:14:14 +0000
commitdf8634e34b9fa8cdcc69579d0905202696f15d9c (patch)
treec6b252cafbc956f67912cee24a9e5852471a73b4 /bfd
parent179ae6ea64567f2be7d760c619c6a470b3de520c (diff)
downloadgdb-df8634e34b9fa8cdcc69579d0905202696f15d9c.zip
gdb-df8634e34b9fa8cdcc69579d0905202696f15d9c.tar.gz
gdb-df8634e34b9fa8cdcc69579d0905202696f15d9c.tar.bz2
(elf32_hppa_set_gp): Handle weak $global$.
If $global$ referenced but not defined, set its value here.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf32-hppa.c14
2 files changed, 18 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 341728e..0df7160 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2001-02-13 Alan Modra <alan@linuxcare.com.au>
+
+ * elf32-hppa.c (elf32_hppa_set_gp): Handle weak $global$. If
+ $global$ referenced but not defined, set its value here.
+
2001-02-09 Bo Thorsen <bo@suse.de>
* elf64-x86-64.c (elf64_x86_64_check_relocs): Set .rela.got section
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index 13f1e5a..63071f3 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)