aboutsummaryrefslogtreecommitdiff
path: root/gas/write.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1996-12-13 18:27:28 +0000
committerIan Lance Taylor <ian@airs.com>1996-12-13 18:27:28 +0000
commit54815b9a0893741e7759a565cc254d989a88e365 (patch)
tree441fa32acee42afe0381b6c641d4d0928bb3e6ee /gas/write.c
parent6270adfb595310da7741a39b57bfe633a9448e5b (diff)
downloadgdb-54815b9a0893741e7759a565cc254d989a88e365.zip
gdb-54815b9a0893741e7759a565cc254d989a88e365.tar.gz
gdb-54815b9a0893741e7759a565cc254d989a88e365.tar.bz2
* write.c (adjust_reloc_syms): Don't reduce a reloc against a
linkonce section into a reloc against the section symbol.
Diffstat (limited to 'gas/write.c')
-rw-r--r--gas/write.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gas/write.c b/gas/write.c
index a7649bf..daf8738 100644
--- a/gas/write.c
+++ b/gas/write.c
@@ -718,6 +718,24 @@ adjust_reloc_syms (abfd, sec, xxx)
goto done;
}
+#ifdef BFD_ASSEMBLER
+ /* Don't try to reduce relocs which refer to .linkonce
+ sections. It can lead to confusion when a debugging
+ section refers to a .linkonce section. I hope this will
+ always be correct. */
+ if (symsec != sec
+ && ((bfd_get_section_flags (stdoutput, symsec) & SEC_LINK_ONCE)
+ != 0))
+ {
+ fixp->fx_addsy->sy_used_in_reloc = 1;
+#ifdef UNDEFINED_DIFFERENCE_OK
+ if (fixp->fx_subsy != NULL)
+ fixp->fx_subsy->sy_used_in_reloc = 1;
+#endif
+ goto done;
+ }
+#endif
+
/* Since we're reducing to section symbols, don't attempt to reduce
anything that's already using one. */
if (sym->bsym->flags & BSF_SECTION_SYM)