aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2007-03-21 04:03:09 +0000
committerH.J. Lu <hjl.tools@gmail.com>2007-03-21 04:03:09 +0000
commit749b8d9d455c809f51b2886df79a86a108dd5665 (patch)
tree3a7a3eb3b5f67cd099259dac48ac8af469ae51c0 /bfd
parent75b06e7b7a1972cba3f0f3b1e36010eb7cd99d78 (diff)
downloadgdb-749b8d9d455c809f51b2886df79a86a108dd5665.zip
gdb-749b8d9d455c809f51b2886df79a86a108dd5665.tar.gz
gdb-749b8d9d455c809f51b2886df79a86a108dd5665.tar.bz2
2003-03-19 H.J. Lu <hongjiu.lu@intel.com>
PR ld/4208 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Report missing matching LO16 relocation for HI16 relocation.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elfxx-mips.c27
2 files changed, 28 insertions, 5 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 004bfe7..e33adfb 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2003-03-20 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/4208
+ * elfxx-mips.c (_bfd_mips_elf_relocate_section): Report missing
+ matching LO16 relocation for HI16 relocation.
+
2007-03-20 Paul Brook <paul@codesourcery.com>
* bfd-in.h (bfd_elf32_arm_set_target_relocs): Update prototype.
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index 8f73840..40ae730 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -7756,6 +7756,8 @@ _bfd_mips_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
const char *msg;
unsigned long r_symndx;
asection *sec;
+ Elf_Internal_Shdr *symtab_hdr;
+ struct elf_link_hash_entry *h;
/* Find the relocation howto for this relocation. */
howto = MIPS_ELF_RTYPE_TO_HOWTO (input_bfd, r_type,
@@ -7765,15 +7767,16 @@ _bfd_mips_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
rel - relocs)));
r_symndx = ELF_R_SYM (input_bfd, rel->r_info);
+ symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
if (mips_elf_local_relocation_p (input_bfd, rel, local_sections, FALSE))
- sec = local_sections[r_symndx];
+ {
+ sec = local_sections[r_symndx];
+ h = NULL;
+ }
else
{
- Elf_Internal_Shdr *symtab_hdr;
unsigned long extsymoff;
- struct elf_link_hash_entry *h;
- symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
extsymoff = 0;
if (!elf_bad_symtab (input_bfd))
extsymoff = symtab_hdr->sh_info;
@@ -7885,7 +7888,21 @@ _bfd_mips_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
lo16_type,
rel, relend);
if (lo16_relocation == NULL)
- return FALSE;
+ {
+ const char *name;
+
+ if (h)
+ name = h->root.root.string;
+ else
+ name = bfd_elf_sym_name (input_bfd, symtab_hdr,
+ local_syms + r_symndx,
+ sec);
+ (*_bfd_error_handler)
+ (_("%B: Can't find matching LO16 reloc against `%s' for %s at 0x%lx in section `%A'"),
+ input_bfd, input_section, name, howto->name,
+ rel->r_offset);
+ return FALSE;
+ }
lo16_location = contents + lo16_relocation->r_offset;