aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-arm.c
diff options
context:
space:
mode:
authorZack Weinberg <zackw@panix.com>2005-06-13 15:34:39 +0000
committerZack Weinberg <zackw@panix.com>2005-06-13 15:34:39 +0000
commit37f6032b8594c94b585732cf7ae09affe8614eee (patch)
tree7d3a71c810ed316b774aad0ff2b6070b5d760810 /gas/config/tc-arm.c
parent7b5c6b52e4427fd82b0240b52acefb12f83db001 (diff)
downloadgdb-37f6032b8594c94b585732cf7ae09affe8614eee.zip
gdb-37f6032b8594c94b585732cf7ae09affe8614eee.tar.gz
gdb-37f6032b8594c94b585732cf7ae09affe8614eee.tar.bz2
gas:
* config/tc-arm.c (find_real_start): Check S_IS_LOCAL on symbolP as well as for names with a leading dot. Use ACONCAT. (md_apply_fix): For branch relocations, only replace value with fixP->fx_offset (under #ifdef OBJ_ELF) when !fixP->fx_done. (arm_force_relocation): Remove #ifdef OBJ_ELF case. * config/tc-arm.h (LOCAL_LABEL): Remove unnecessary parentheses. (LOCAL_LABEL_PREFIX): Don't define. gas/testsuite: * gas/arm/thumb.s: Only branch to labels defined in this file. * gas/arm/thumb.d, gas/arm/thumb32.d: Adjust expected output.
Diffstat (limited to 'gas/config/tc-arm.c')
-rw-r--r--gas/config/tc-arm.c32
1 files changed, 13 insertions, 19 deletions
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index a3cc432..2288d99 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -1414,15 +1414,15 @@ find_real_start (symbolS * symbolP)
if (name == NULL)
abort ();
- /* Names that start with '.' are local labels, not function entry points.
- The compiler may generate BL instructions to these labels because it
- needs to perform a branch to a far away location. */
- if (name[0] == '.')
+ /* The compiler may generate BL instructions to local labels because
+ it needs to perform a branch to a far away location. These labels
+ do not have a corresponding ".real_start_of" label. We check
+ both for S_IS_LOCAL and for a leading dot, to give a way to bypass
+ the ".real_start_of" convention for nonlocal branches. */
+ if (S_IS_LOCAL (symbolP) || name[0] == '.')
return symbolP;
- real_start = malloc (strlen (name) + strlen (STUB_NAME) + 1);
- sprintf (real_start, "%s%s", STUB_NAME, name);
-
+ real_start = ACONCAT ((STUB_NAME, name, NULL));
new_target = symbol_find (real_start);
if (new_target == NULL)
@@ -1431,8 +1431,6 @@ find_real_start (symbolS * symbolP)
new_target = symbolP;
}
- free (real_start);
-
return new_target;
}
@@ -10513,7 +10511,8 @@ md_apply_fix (fixS * fixP,
#define SEXT24(x) ((((x) & 0xffffff) ^ (~ 0x7fffff)) + 0x800000)
#ifdef OBJ_ELF
- value = fixP->fx_offset;
+ if (!fixP->fx_done)
+ value = fixP->fx_offset;
#endif
/* We are going to store value (shifted right by two) in the
@@ -10583,7 +10582,8 @@ md_apply_fix (fixS * fixP,
newval = md_chars_to_number (buf, INSN_SIZE);
#ifdef OBJ_ELF
- value = fixP->fx_offset;
+ if (!fixP->fx_done)
+ value = fixP->fx_offset;
#endif
hbit = (value >> 1) & 1;
value = (value >> 2) & 0x00ffffff;
@@ -10742,7 +10742,8 @@ md_apply_fix (fixS * fixP,
if (diff & 0x400000)
diff |= ~0x3fffff;
#ifdef OBJ_ELF
- value = fixP->fx_offset;
+ if (!fixP->fx_done)
+ value = fixP->fx_offset;
#endif
value += diff;
@@ -11353,13 +11354,6 @@ arm_force_relocation (struct fix * fixp)
if (fixp->fx_r_type == BFD_RELOC_RVA)
return 1;
#endif
-#ifdef OBJ_ELF
- if (fixp->fx_r_type == BFD_RELOC_ARM_PCREL_BRANCH
- || fixp->fx_r_type == BFD_RELOC_ARM_PCREL_BLX
- || fixp->fx_r_type == BFD_RELOC_THUMB_PCREL_BLX
- || fixp->fx_r_type == BFD_RELOC_THUMB_PCREL_BRANCH23)
- return 1;
-#endif
/* Resolve these relocations even if the symbol is extern or weak. */
if (fixp->fx_r_type == BFD_RELOC_ARM_IMMEDIATE