diff options
author | Eric Christopher <echristo@gmail.com> | 2005-04-05 06:58:46 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2005-04-05 06:58:46 +0000 |
commit | 8236346f4669711b5fcff0f02a2e0d1d37983ff3 (patch) | |
tree | 00d8967d0bc495d438688158e402323a7baf1962 /bfd | |
parent | da9f89d4e2ddc91160b2056d290031afd868cb90 (diff) | |
download | gdb-8236346f4669711b5fcff0f02a2e0d1d37983ff3.zip gdb-8236346f4669711b5fcff0f02a2e0d1d37983ff3.tar.gz gdb-8236346f4669711b5fcff0f02a2e0d1d37983ff3.tar.bz2 |
2005-04-04 Eric Christopher <echristo@redhat.com>
* elfxx-mips.c (_bfd_elf_mips_get_relocated_section_contents):
Clean up gp handling code.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elfxx-mips.c | 37 |
2 files changed, 19 insertions, 23 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 928d1dd..86401c8 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2005-04-04 Eric Christopher <echristo@redhat.com> + + * elfxx-mips.c (_bfd_elf_mips_get_relocated_section_contents): + Clean up gp handling code. + 2005-04-04 H.J. Lu <hongjiu.lu@intel.com> * elf.c (bfd_elf_set_group_contents): Ignore linker created diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index a4baea9..9aae75f 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -8754,30 +8754,21 @@ _bfd_elf_mips_get_relocated_section_contents /* Specific to MIPS: Deal with relocation types that require knowing the gp of the output bfd. */ asymbol *sym = *(*parent)->sym_ptr_ptr; - if (bfd_is_abs_section (sym->section) && abfd) - { - /* The special_function wouldn't get called anyway. */ - } - else if (!gp_found) - { - /* The gp isn't there; let the special function code - fall over on its own. */ - } - else if ((*parent)->howto->special_function - == _bfd_mips_elf32_gprel16_reloc) - { - /* bypass special_function call */ - r = _bfd_mips_elf_gprel16_with_gp (input_bfd, sym, *parent, - input_section, relocatable, - data, gp); - goto skip_bfd_perform_relocation; - } - /* end mips specific stuff */ - r = bfd_perform_relocation (input_bfd, *parent, data, input_section, - relocatable ? abfd : NULL, - &error_message); - skip_bfd_perform_relocation: + /* If we've managed to find the gp and have a special + function for the relocation then go ahead, else default + to the generic handling. */ + if (gp_found + && (*parent)->howto->special_function + == _bfd_mips_elf32_gprel16_reloc) + r = _bfd_mips_elf_gprel16_with_gp (input_bfd, sym, *parent, + input_section, relocatable, + data, gp); + else + r = bfd_perform_relocation (input_bfd, *parent, data, + input_section, + relocatable ? abfd : NULL, + &error_message); if (relocatable) { |