Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/gnu/dist/toolchain/gas/config When emitting a GOT reloc, use...



details:   https://anonhg.NetBSD.org/src/rev/ffed74d028dc
branches:  trunk
changeset: 522518:ffed74d028dc
user:      matt <matt%NetBSD.org@localhost>
date:      Wed Feb 20 18:50:40 2002 +0000

description:
When emitting a GOT reloc, use the frag symbol since we want the
external name, not where it lives in this object (which would happen
in the symbol was defined locally).  All, don't use offset but addnumber.

diffstat:

 gnu/dist/toolchain/gas/config/tc-vax.c |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r 4aacb9fc351d -r ffed74d028dc gnu/dist/toolchain/gas/config/tc-vax.c
--- a/gnu/dist/toolchain/gas/config/tc-vax.c    Wed Feb 20 17:49:14 2002 +0000
+++ b/gnu/dist/toolchain/gas/config/tc-vax.c    Wed Feb 20 18:50:40 2002 +0000
@@ -3522,7 +3522,12 @@
 
   reloc = (arelent *) xmalloc (sizeof (arelent));
   reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
-  *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
+#ifdef OBJ_ELF
+  if (code == BFD_RELOC_32_GOT_PCREL)
+    *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_frag->fr_symbol);
+  else
+#endif
+    *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
   reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
 #ifndef OBJ_ELF
   if (fixp->fx_pcrel)
@@ -3530,7 +3535,10 @@
   else
     reloc->addend = 0;
 #elif defined(OBJ_ELF)
-  reloc->addend = fixp->fx_offset;
+  if (code != BFD_RELOC_32_GOT_PCREL)
+    reloc->addend = fixp->fx_offset;
+  else
+    reloc->addend = fixp->fx_addnumber;
 #else
   if (!fixp->fx_pcrel)
     {



Home | Main Index | Thread Index | Old Index