From: Richard Henderson Date: Fri, 15 Feb 2002 21:24:36 +0000 (+0000) Subject: * elf64-alpha.c (elf64_alpha_relocate_section) [BRSGP]: A target X-Git-Tag: binutils-2_12~51 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c1c632307cbe86fdc56a7207c036db45d74387de;p=thirdparty%2Fbinutils-gdb.git * elf64-alpha.c (elf64_alpha_relocate_section) [BRSGP]: A target section with no got matches any got. Simplify error generaion. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 01727d85279..55fff49802e 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2002-02-15 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relocate_section) [BRSGP]: A target + section with no got matches any got. Simplify error generaion. + 2002-02-14 Alan Modra * elf.c (elf_fake_sections): Use SHT_NOBITS when SEC_NEVER_LOAD. diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c index 6df126a4d13..ad8fc302d38 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 = _(""); - 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; }