aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2003-01-08 22:00:53 +0000
committerAlexandre Oliva <aoliva@redhat.com>2003-01-08 22:00:53 +0000
commitab7d0aa081fb42d109e3aa3c3e8ce03e1fd21ea9 (patch)
tree130f1a3c07fb0da114441e12d5d2c641f9ba264a /bfd
parent7f8ab3a0b79a3e32e4eea5da87da2110b1ecb166 (diff)
downloadgdb-ab7d0aa081fb42d109e3aa3c3e8ce03e1fd21ea9.zip
gdb-ab7d0aa081fb42d109e3aa3c3e8ce03e1fd21ea9.tar.gz
gdb-ab7d0aa081fb42d109e3aa3c3e8ce03e1fd21ea9.tar.bz2
* elfn32-mips.c (prev_reloc_section): New.
(GET_RELOC_ADDEND): Use it. Parenthesize macro arguments. (SET_RELOC_ADDEND): Parenthesize macro argument.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elfn32-mips.c27
2 files changed, 21 insertions, 12 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 81f78a0..a2260f4 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2003-01-08 Alexandre Oliva <aoliva@redhat.com>
+
+ * elfn32-mips.c (prev_reloc_section): New.
+ (GET_RELOC_ADDEND): Use it. Parenthesize macro arguments.
+ (SET_RELOC_ADDEND): Parenthesize macro argument.
+
2003-01-07 John David Anglin <dave.anglin@nrc.gc.ca>
* elf32-hppa.c (final_link_relocate): For all DP relative relocations,
diff --git a/bfd/elfn32-mips.c b/bfd/elfn32-mips.c
index 144a9da..269c98c 100644
--- a/bfd/elfn32-mips.c
+++ b/bfd/elfn32-mips.c
@@ -1,6 +1,6 @@
/* MIPS-specific support for 32-bit ELF
- Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
- Free Software Foundation, Inc.
+ Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+ 2003 Free Software Foundation, Inc.
Most of the information added by Ian Lance Taylor, Cygnus Support,
<ian@cygnus.com>.
@@ -96,6 +96,7 @@ static irix_compat_t elf_n32_mips_irix_compat
extern const bfd_target bfd_elf32_nbigmips_vec;
extern const bfd_target bfd_elf32_nlittlemips_vec;
+static asection *prev_reloc_section = NULL;
static bfd_vma prev_reloc_address = -1;
static bfd_vma prev_reloc_addend = 0;
@@ -1207,29 +1208,31 @@ static reloc_howto_type elf_mips_gnu_vtentry_howto =
{ \
/* If we're relocating, and this is an external symbol, we don't \
want to change anything. */ \
- if (obfd != (bfd *) NULL \
- && (sym->flags & BSF_SECTION_SYM) == 0 \
- && (! entry->howto->partial_inplace \
- || entry->addend == 0)) \
+ if ((obfd) != (bfd *) NULL \
+ && ((sym)->flags & BSF_SECTION_SYM) == 0 \
+ && (! (entry)->howto->partial_inplace \
+ || (entry)->addend == 0)) \
{ \
- entry->address += sec->output_offset; \
+ (entry)->address += (sec)->output_offset; \
return bfd_reloc_ok; \
} \
\
/* The addend of combined relocs is remembered and left for \
subsequent relocs. */ \
- if (prev_reloc_address != reloc_entry->address) \
+ if (prev_reloc_address != (entry)->address \
+ || prev_reloc_section != (sec)) \
{ \
- prev_reloc_address = reloc_entry->address; \
- prev_reloc_addend = reloc_entry->addend; \
+ prev_reloc_section = (sec); \
+ prev_reloc_address = (entry)->address; \
+ prev_reloc_addend = (entry)->addend; \
} \
else \
- reloc_entry->addend = prev_reloc_addend; \
+ (entry)->addend = prev_reloc_addend; \
}
#define SET_RELOC_ADDEND(entry) \
{ \
- prev_reloc_addend = entry->addend; \
+ prev_reloc_addend = (entry)->addend; \
}
static bfd_reloc_status_type