aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>1999-11-18 18:36:35 +0000
committerNick Clifton <nickc@redhat.com>1999-11-18 18:36:35 +0000
commit078c8694a9d03160f630e006a689e7d1ff559f95 (patch)
treea53b243aa7b8f6e1e40e97d2a5c31bd086ab32f5
parent86dc0f79f59480ef98f870c71d2e38ea23e56a04 (diff)
downloadgdb-078c8694a9d03160f630e006a689e7d1ff559f95.zip
gdb-078c8694a9d03160f630e006a689e7d1ff559f95.tar.gz
gdb-078c8694a9d03160f630e006a689e7d1ff559f95.tar.bz2
Fix processing of RVA relocs
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/coff-mcore.c12
2 files changed, 18 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index af1173c..d26847c 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+1999-11-18 Nick Clifton <nickc@cygnus.com>
+
+ * coff-mcore.c (coff_mcore_rtype_to_howto): Special case handling
+ for RVA relocs.
+ (coff_mcore_relocate_section): Initialise addend to 0.
+ Special case processing of RVA reloc.
+
1999-11-17 Richard Henderson <rth@cygnus.com>
* elf-bfd.h (struct elf_backend_data): Reorder collect and
diff --git a/bfd/coff-mcore.c b/bfd/coff-mcore.c
index 48f1525..a644db1 100644
--- a/bfd/coff-mcore.c
+++ b/bfd/coff-mcore.c
@@ -339,7 +339,7 @@ coff_mcore_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
if (rel->r_type == IMAGE_REL_MCORE_RVA)
* addendp -= pe_data (sec->output_section->owner)->pe_opthdr.ImageBase;
- if (howto->pc_relative)
+ else if (howto->pc_relative)
{
* addendp = sec->vma - 2; /* XXX guess - is this right ? */
@@ -440,6 +440,8 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section,
sym = syms + symndx;
}
+ addend = 0;
+
/* Get the howto and initialise the addend. */
howto = bfd_coff_rtype_to_howto (input_bfd, input_section, rel, h,
sym, & addend);
@@ -527,8 +529,16 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section,
case IMAGE_REL_MCORE_PCREL_JSR_IMM11BY2:
case IMAGE_REL_MCORE_ADDR32:
case IMAGE_REL_MCORE_RVA:
+ /* XXX fixme - shouldn't this be like the code for the RVA reloc ? */
rstat = _bfd_relocate_contents (howto, input_bfd, val, loc);
break;
+
+ case IMAGE_REL_MCORE_RVA:
+ rstat = _bfd_final_link_relocate
+ (howto, input_bfd,
+ input_section, contents, rel->r_vaddr - input_section->vma,
+ val, addend);
+ break;
}
if (info->base_file)