* config/tc-hppa.c (tc_gen_reloc, ELF variant): Add section->vma
authorJeff Law <law@redhat.com>
Wed, 23 Nov 1994 06:34:13 +0000 (06:34 +0000)
committerJeff Law <law@redhat.com>
Wed, 23 Nov 1994 06:34:13 +0000 (06:34 +0000)
to the relocation's offset.

gas/ChangeLog
gas/config/tc-hppa.c

index b7a480eb6a7032ba1eeb190db631e229133c5dcd..30d32a4785df6e61c596b5b8bd022ce730816c8e 100644 (file)
@@ -1,3 +1,8 @@
+Tue Nov 22 23:31:20 1994  Jeff Law  (law@snake.cs.utah.edu)
+
+       * config/tc-hppa.c (tc_gen_reloc, ELF variant): Add section->vma
+       to the relocation's offset.
+
 Tue Nov 22 14:37:58 1994  Steve Chamberlain  (sac@jonny.cygnus.com)
 
        * Makefile.in (INSTALL_XFORM): Fix typo.
index 498f40e3ea2364d53609ec8ebb2eef14fda5d39f..c1ec189b140e7226cd3079ddf2cf93faa3e62059 100644 (file)
@@ -2568,7 +2568,15 @@ tc_gen_reloc (section, fixp)
 
       reloc->sym_ptr_ptr = &fixp->fx_addsy->bsym;
       reloc->howto = bfd_reloc_type_lookup (stdoutput, code);
-      reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
+      /* Ugh.  Yet another case where the generic ELF code's
+        handling of section vmas makes life a living hell.
+
+        The generic ELF code will subtract out section->vma from
+        the relocation offset before the relocs are written.  So
+        we have to add section->vma into the offset here so the
+        net sum is zero.  */
+      reloc->address = (fixp->fx_frag->fr_address + fixp->fx_where
+                       + section->vma);
       reloc->addend = 0;       /* default */
 
       assert (reloc->howto && code == reloc->howto->type);
This page took 0.038596 seconds and 4 git commands to generate.