aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-hppa.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1994-11-23 06:34:13 +0000
committerJeff Law <law@redhat.com>1994-11-23 06:34:13 +0000
commit740e5428b09a1e205b75dd177baf0d99167d21db (patch)
tree645e35882d82850480734619a301948eaf9ba6ba /gas/config/tc-hppa.c
parent43ab4ba582a495a5c0f13c1e0869b6a241442611 (diff)
downloadgdb-740e5428b09a1e205b75dd177baf0d99167d21db.zip
gdb-740e5428b09a1e205b75dd177baf0d99167d21db.tar.gz
gdb-740e5428b09a1e205b75dd177baf0d99167d21db.tar.bz2
* config/tc-hppa.c (tc_gen_reloc, ELF variant): Add section->vma
to the relocation's offset.
Diffstat (limited to 'gas/config/tc-hppa.c')
-rw-r--r--gas/config/tc-hppa.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gas/config/tc-hppa.c b/gas/config/tc-hppa.c
index 498f40e..c1ec189 100644
--- a/gas/config/tc-hppa.c
+++ b/gas/config/tc-hppa.c
@@ -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);