mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-09-13 02:14:39 +08:00
gas/
* config/tc-xtensa.c (xg_symbolic_immeds_fit): Relax for weak references but not weak definitions. gas/testsuite/ * gas/xtensa/all.exp: Run new weak-call test. * gas/xtensa/weak-call.d: New. * gas/xtensa/weak-call.s: New.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2007-12-13 Bob Wilson <bob.wilson@acm.org>
|
||||||
|
|
||||||
|
* config/tc-xtensa.c (xg_symbolic_immeds_fit): Relax for weak
|
||||||
|
references but not weak definitions.
|
||||||
|
|
||||||
2007-12-12 Bob Wilson <bob.wilson@acm.org>
|
2007-12-12 Bob Wilson <bob.wilson@acm.org>
|
||||||
|
|
||||||
* config/tc-xtensa.c (xg_symbolic_immeds_fit): Do not relax calls to
|
* config/tc-xtensa.c (xg_symbolic_immeds_fit): Do not relax calls to
|
||||||
|
@ -3241,9 +3241,15 @@ xg_symbolic_immeds_fit (const TInsn *insn,
|
|||||||
|| S_GET_SEGMENT (expr->X_add_symbol) != pc_seg)
|
|| S_GET_SEGMENT (expr->X_add_symbol) != pc_seg)
|
||||||
{
|
{
|
||||||
/* For a direct call with --no-longcalls, be optimistic and
|
/* For a direct call with --no-longcalls, be optimistic and
|
||||||
assume it will be in range. */
|
assume it will be in range. If the symbol is weak and
|
||||||
|
undefined, it may remain undefined at link-time, in which
|
||||||
|
case it will have a zero value and almost certainly be out
|
||||||
|
of range for a direct call; thus, relax for undefined weak
|
||||||
|
symbols even if longcalls is not enabled. */
|
||||||
if (is_direct_call_opcode (insn->opcode)
|
if (is_direct_call_opcode (insn->opcode)
|
||||||
&& ! pc_frag->tc_frag_data.use_longcalls)
|
&& ! pc_frag->tc_frag_data.use_longcalls
|
||||||
|
&& (! S_IS_WEAK (expr->X_add_symbol)
|
||||||
|
|| S_IS_DEFINED (expr->X_add_symbol)))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
2007-12-13 Bob Wilson <bob.wilson@acm.org>
|
||||||
|
|
||||||
|
* gas/xtensa/all.exp: Run new weak-call test.
|
||||||
|
* gas/xtensa/weak-call.d: New.
|
||||||
|
* gas/xtensa/weak-call.s: New.
|
||||||
|
|
||||||
2007-12-11 Catherine Moore <clm@codesourcery.com>
|
2007-12-11 Catherine Moore <clm@codesourcery.com>
|
||||||
|
|
||||||
gas/elf/symtab.s: New test.
|
gas/elf/symtab.s: New test.
|
||||||
|
@ -80,6 +80,7 @@ if [istarget xtensa*-*-*] then {
|
|||||||
|
|
||||||
run_dump_test "short_branch_offset"
|
run_dump_test "short_branch_offset"
|
||||||
run_dump_test "pcrel"
|
run_dump_test "pcrel"
|
||||||
|
run_dump_test "weak-call"
|
||||||
}
|
}
|
||||||
|
|
||||||
if [info exists errorInfo] then {
|
if [info exists errorInfo] then {
|
||||||
|
11
gas/testsuite/gas/xtensa/weak-call.d
Normal file
11
gas/testsuite/gas/xtensa/weak-call.d
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#as:
|
||||||
|
#objdump: -r -j .text
|
||||||
|
#name: relaxing calls to weak symbols
|
||||||
|
|
||||||
|
.*: +file format .*xtensa.*
|
||||||
|
|
||||||
|
RELOCATION RECORDS FOR \[\.text\]:
|
||||||
|
OFFSET TYPE VALUE
|
||||||
|
00000000 R_XTENSA_SLOT0_OP weakdef
|
||||||
|
00000003 R_XTENSA_SLOT0_OP \.literal
|
||||||
|
00000003 R_XTENSA_ASM_EXPAND weakref
|
8
gas/testsuite/gas/xtensa/weak-call.s
Normal file
8
gas/testsuite/gas/xtensa/weak-call.s
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
.text
|
||||||
|
.begin no-longcalls
|
||||||
|
.weak weakdef
|
||||||
|
call8 weakdef
|
||||||
|
weakdef:
|
||||||
|
.weak weakref
|
||||||
|
call8 weakref
|
||||||
|
.end no-longcalls
|
Reference in New Issue
Block a user