aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-alpha.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2002-02-15 21:26:05 +0000
committerRichard Henderson <rth@redhat.com>2002-02-15 21:26:05 +0000
commitccf00ab6a1bf897a53932aa904a804e539e66c31 (patch)
tree3edfabbbdbf5c33821d0ba96dc99ec6e1bd93abc /bfd/elf64-alpha.c
parent8bf7d691eb8662b118fa709a530e64ac9e17e85d (diff)
downloadgdb-ccf00ab6a1bf897a53932aa904a804e539e66c31.zip
gdb-ccf00ab6a1bf897a53932aa904a804e539e66c31.tar.gz
gdb-ccf00ab6a1bf897a53932aa904a804e539e66c31.tar.bz2
* elf64-alpha.c (elf64_alpha_relocate_section) [BRSGP]: A target
section with no got matches any got. Simplify error generaion.
Diffstat (limited to 'bfd/elf64-alpha.c')
-rw-r--r--bfd/elf64-alpha.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c
index d0d3251..53ac1e7 100644
--- a/bfd/elf64-alpha.c
+++ b/bfd/elf64-alpha.c
@@ -3581,24 +3581,18 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
the instruction rather than the end. */
addend -= 4;
- /* The source and destination gp must be the same. */
- if (h != NULL
+ /* The source and destination gp must be the same. Note that
+ the source will always have an assigned gp, since we forced
+ one in check_relocs, but that the destination may not, as
+ it might not have had any relocations at all. Also take
+ care not to crash if H is an undefined symbol. */
+ if (h != NULL && sec != NULL
+ && alpha_elf_tdata (sec->owner)->gotobj
&& gotobj != alpha_elf_tdata (sec->owner)->gotobj)
{
- if (h != NULL)
- name = h->root.root.root.string;
- else
- {
- name = (bfd_elf_string_from_elf_section
- (input_bfd, symtab_hdr->sh_link, sym->st_name));
- if (name == NULL)
- name = _("<unknown>");
- else if (name[0] == 0)
- name = bfd_section_name (input_bfd, sec);
- }
(*_bfd_error_handler)
(_("%s: change in gp: BRSGP %s"),
- bfd_archive_filename (input_bfd), name);
+ bfd_archive_filename (input_bfd), h->root.root.root.string);
ret_val = false;
}