aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2001-11-14 14:07:26 +0000
committerNick Clifton <nickc@redhat.com>2001-11-14 14:07:26 +0000
commit42ebd756d5f67ae48a379c0d433ffc42f97f9d54 (patch)
tree21bb668f3cbc29cfbaf412d81f3cbb65f472dc79 /gas
parent58a35813625d12f9f5e033cec8fbbf38a6e13df7 (diff)
downloadgdb-42ebd756d5f67ae48a379c0d433ffc42f97f9d54.zip
gdb-42ebd756d5f67ae48a379c0d433ffc42f97f9d54.tar.gz
gdb-42ebd756d5f67ae48a379c0d433ffc42f97f9d54.tar.bz2
Do not remove the symbol's value from the addend for fixups against local
symbols in SEC_MERGE sections - it was not added in, in the first place.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/config/tc-sparc.c37
2 files changed, 28 insertions, 15 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index adf6e1a..337c8dc 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2001-11-14 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * config/tc-sparc.c (md_apply_fix3): Do not remove the symbol's
+ value from the addend for fixups against local symbols in
+ SEC_MERGE sections - it was not added in, in the first place.
+
2001-11-11 Timothy Wall <twall@alum.mit.edu>
* write.c (relax_segment): Convert symbol address into an octet
diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c
index 692a7fa..0809383 100644
--- a/gas/config/tc-sparc.c
+++ b/gas/config/tc-sparc.c
@@ -2905,22 +2905,29 @@ md_apply_fix3 (fixP, value, segment)
don't want to include the value of an externally visible symbol. */
if (fixP->fx_addsy != NULL)
{
- if (symbol_used_in_reloc_p (fixP->fx_addsy)
- && (S_IS_EXTERNAL (fixP->fx_addsy)
- || S_IS_WEAK (fixP->fx_addsy)
- || (S_GET_SEGMENT (fixP->fx_addsy)->flags & SEC_MERGE)
+ symbolS * sym = fixP->fx_addsy;
+ segT seg = S_GET_SEGMENT (sym);
+
+ if (symbol_used_in_reloc_p (sym)
+ && (S_IS_EXTERNAL (sym)
+ || S_IS_WEAK (sym)
+#if 0 /* Although fixups against local symbols in SEC_MERGE sections
+ should be treated as if they were against external symbols
+ write.c:fixup_segment() will not have included the value of
+ the symbol under these particular cicumstances. */
+ || (seg->flags & SEC_MERGE)
+#endif
|| (sparc_pic_code && ! fixP->fx_pcrel)
- || (S_GET_SEGMENT (fixP->fx_addsy) != segment
- && ((bfd_get_section_flags (stdoutput,
- S_GET_SEGMENT (fixP->fx_addsy))
- & SEC_LINK_ONCE) != 0
- || strncmp (segment_name (S_GET_SEGMENT (fixP->fx_addsy)),
- ".gnu.linkonce",
- sizeof ".gnu.linkonce" - 1) == 0)))
- && S_GET_SEGMENT (fixP->fx_addsy) != absolute_section
- && S_GET_SEGMENT (fixP->fx_addsy) != undefined_section
- && ! bfd_is_com_section (S_GET_SEGMENT (fixP->fx_addsy)))
- fixP->fx_addnumber -= S_GET_VALUE (fixP->fx_addsy);
+ || (seg != segment
+ && (((bfd_get_section_flags (stdoutput, seg) & SEC_LINK_ONCE) != 0)
+ || (strncmp (segment_name (seg),
+ ".gnu.linkonce",
+ sizeof ".gnu.linkonce" - 1) == 0))))
+ && seg != absolute_section
+ && seg != undefined_section
+ && ! bfd_is_com_section (seg))
+ fixP->fx_addnumber -= S_GET_VALUE (sym);
+
return 1;
}
#endif