aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-mips.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>1999-07-19 20:11:22 +0000
committerMark Mitchell <mark@codesourcery.com>1999-07-19 20:11:22 +0000
commitf1a5f37efe8ec6ebe6d180317e1e213b01c329a9 (patch)
treee8546b5863f7e095ca02632f2048e5e3a7f5081c /bfd/elf32-mips.c
parent0db63c186806ee28245973963a73d6e24a422475 (diff)
downloadgdb-f1a5f37efe8ec6ebe6d180317e1e213b01c329a9.zip
gdb-f1a5f37efe8ec6ebe6d180317e1e213b01c329a9.tar.gz
gdb-f1a5f37efe8ec6ebe6d180317e1e213b01c329a9.tar.bz2
Fix typo in last change.
Diffstat (limited to 'bfd/elf32-mips.c')
-rw-r--r--bfd/elf32-mips.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c
index 9ae6e6d..cdcf65c 100644
--- a/bfd/elf32-mips.c
+++ b/bfd/elf32-mips.c
@@ -6551,22 +6551,14 @@ _bfd_mips_elf_relocate_section (output_bfd, info, input_bfd, input_section,
that we're adjusting GP in this relocateable object. */
if (!mips_elf_local_relocation_p (input_bfd, rel, local_sections))
- /* A non-local relocation is never against a section. */
+ /* There's nothing to do for non-local relocations. */
continue;
r_symndx = ELF32_R_SYM (rel->r_info);
sym = local_syms + r_symndx;
if (ELF_ST_TYPE (sym->st_info) == STT_SECTION)
- {
- /* Adjust the addend appropriately. */
- addend += local_sections[r_symndx]->output_offset;
-
- /* If the relocation is for a R_MIPS_HI16 or R_MIPS_GOT16,
- then we only want to write out the high-order 16 bits.
- The subsequent R_MIPS_LO16 will handle the low-order bits. */
- if (r_type == R_MIPS_HI16 || r_type == R_MIPS_GOT16)
- addend >>= 16;
- }
+ /* Adjust the addend appropriately. */
+ addend += local_sections[r_symndx]->output_offset;
if (r_type == R_MIPS16_GPREL
|| r_type == R_MIPS_GPREL16
@@ -6574,6 +6566,12 @@ _bfd_mips_elf_relocate_section (output_bfd, info, input_bfd, input_section,
addend -= (_bfd_get_gp_value (output_bfd)
- _bfd_get_gp_value (input_bfd));
+ /* If the relocation is for a R_MIPS_HI16 or R_MIPS_GOT16,
+ then we only want to write out the high-order 16 bits.
+ The subsequent R_MIPS_LO16 will handle the low-order bits. */
+ if (r_type == R_MIPS_HI16 || r_type == R_MIPS_GOT16)
+ addend >>= 16;
+
if (rela_relocation_p)
/* If this is a RELA relocation, just update the addend.
We have to cast away constness for REL. */