* mn10300 gas fix
@ 2010-09-23 12:12 Alan Modra
0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2010-09-23 12:12 UTC (permalink / raw)
To: binutils
Fixes a problem exposed by my 2008-08-20 PR 6848 gas patch.
ERROR: /src/binutils-current/ld/testsuite/ld-mn10300/i112045-1.s: assembly failed
* config/tc-mn10300.c (tc_gen_reloc): Replace absolute symbols
with the absolute section symbol.
Index: gas/config/tc-mn10300.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mn10300.c,v
retrieving revision 1.72
diff -u -p -r1.72 tc-mn10300.c
--- gas/config/tc-mn10300.c 8 Sep 2010 11:07:39 -0000 1.72
+++ gas/config/tc-mn10300.c 23 Sep 2010 05:24:52 -0000
@@ -2191,8 +2191,6 @@ tc_gen_reloc (asection *seg ATTRIBUTE_UN
asec = S_GET_SEGMENT (fixp->fx_addsy);
ssec = S_GET_SEGMENT (fixp->fx_subsy);
- reloc->sym_ptr_ptr = NULL;
-
/* If we have a difference between two (non-absolute) symbols we must
generate two relocs (one for each symbol) and allow the linker to
resolve them - relaxation may change the distances between symbols,
@@ -2212,10 +2210,15 @@ tc_gen_reloc (asection *seg ATTRIBUTE_UN
reloc->addend = fixp->fx_offset;
if (asec == absolute_section)
- reloc->addend += S_GET_VALUE (fixp->fx_addsy);
-
- reloc->sym_ptr_ptr = xmalloc (sizeof (asymbol *));
- *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
+ {
+ reloc->addend += S_GET_VALUE (fixp->fx_addsy);
+ reloc->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
+ }
+ else
+ {
+ reloc->sym_ptr_ptr = xmalloc (sizeof (asymbol *));
+ *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
+ }
fixp->fx_pcrel = 0;
fixp->fx_done = 1;
@@ -2252,8 +2255,6 @@ tc_gen_reloc (asection *seg ATTRIBUTE_UN
return relocs;
}
- if (reloc->sym_ptr_ptr)
- free (reloc->sym_ptr_ptr);
free (reloc);
return & no_relocs;
}
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-09-23 12:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-23 12:12 mn10300 gas fix Alan Modra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).