aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2001-05-16 01:48:51 +0000
committerAlexandre Oliva <aoliva@redhat.com>2001-05-16 01:48:51 +0000
commit7e8f4100307db7fcccfc2071ad92f389320d0ec5 (patch)
tree56c9666866b0efd707958e94e8d9bb40c83e72e4
parent2a0fa9433c462c02e2f71b73eb6f3d21d55fc795 (diff)
downloadgdb-7e8f4100307db7fcccfc2071ad92f389320d0ec5.zip
gdb-7e8f4100307db7fcccfc2071ad92f389320d0ec5.tar.gz
gdb-7e8f4100307db7fcccfc2071ad92f389320d0ec5.tar.bz2
* config/tc-mn10300.c (mn10300_force_relocation): Don't
optimize differences between symbols in code sections to constants. (mn10300_fix_adjustable): Don't adjust to section+offset relocations pointing at symbols in code sections.
-rw-r--r--gas/ChangeLog8
-rw-r--r--gas/config/tc-mn10300.c16
2 files changed, 24 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index bb2f95d..9b8c932 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,11 @@
+2001-05-15 Alexandre Oliva <aoliva@redhat.com>
+
+ * config/tc-mn10300.c (mn10300_force_relocation): Don't
+ optimize differences between symbols in code sections to
+ constants.
+ (mn10300_fix_adjustable): Don't adjust to section+offset
+ relocations pointing at symbols in code sections.
+
2001-05-16 Alan Modra <amodra@one.net.au>
* config/tc-arc.c (md_assemble): Correct dwarf2_emit_insn param
diff --git a/gas/config/tc-mn10300.c b/gas/config/tc-mn10300.c
index ab6781a..9f3ee5f 100644
--- a/gas/config/tc-mn10300.c
+++ b/gas/config/tc-mn10300.c
@@ -1993,6 +1993,15 @@ mn10300_force_relocation (fixp)
|| fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
return 1;
+ /* Do not adjust relocations involving symbols in code sections,
+ because it breaks linker relaxations. This could be fixed in the
+ linker, but this fix is simpler, and it pretty much only affects
+ object size a little bit. */
+ if ((S_GET_SEGMENT (fixp->fx_addsy)->flags & SEC_CODE)
+ && fixp->fx_subsy
+ && S_GET_SEGMENT (fixp->fx_addsy) == S_GET_SEGMENT (fixp->fx_subsy))
+ return 1;
+
return 0;
}
@@ -2011,6 +2020,13 @@ mn10300_fix_adjustable (fixp)
|| fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
return 0;
+ /* Do not adjust relocations involving symbols in code sections,
+ because it breaks linker relaxations. This could be fixed in the
+ linker, but this fix is simpler, and it pretty much only affects
+ object size a little bit. */
+ if (S_GET_SEGMENT (fixp->fx_addsy)->flags & SEC_CODE)
+ return 0;
+
return 1;
}