aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2010-09-23 12:11:31 +0000
committerAlan Modra <amodra@gmail.com>2010-09-23 12:11:31 +0000
commit57b3551ee8efbb73064ba8cdd6d13a066e9ba4c7 (patch)
tree52eaf1e07c7e51003f7f410bf6564bd62f1e9c97 /gas
parent4cd284565176740afe80f1bc7a0370e4776deb7c (diff)
downloadgdb-57b3551ee8efbb73064ba8cdd6d13a066e9ba4c7.zip
gdb-57b3551ee8efbb73064ba8cdd6d13a066e9ba4c7.tar.gz
gdb-57b3551ee8efbb73064ba8cdd6d13a066e9ba4c7.tar.bz2
* config/tc-mn10300.c (tc_gen_reloc): Replace absolute symbols
with the absolute section symbol.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-mn10300.c17
2 files changed, 14 insertions, 8 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 024eff5..0df70c7 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2010-09-23 Alan Modra <amodra@gmail.com>
+
+ * config/tc-mn10300.c (tc_gen_reloc): Replace absolute symbols
+ with the absolute section symbol.
+
2010-09-22 Mike Frysinger <vapier@gentoo.org>
* config/bfin-parse.y: Fix typo in BYTEOP16P comment.
diff --git a/gas/config/tc-mn10300.c b/gas/config/tc-mn10300.c
index bf77aa9..0a4f26c 100644
--- a/gas/config/tc-mn10300.c
+++ b/gas/config/tc-mn10300.c
@@ -2191,8 +2191,6 @@ tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp)
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_UNUSED, fixS *fixp)
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_UNUSED, fixS *fixp)
return relocs;
}
- if (reloc->sym_ptr_ptr)
- free (reloc->sym_ptr_ptr);
free (reloc);
return & no_relocs;
}