mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-20 09:58:19 +08:00
2011-05-31 Paul Brook <paul@codesourcery.com>
Nathan Sidwell <nathan@codesourcery.com> gas/ * config/tc-arm.c (fix_new_arm): Create an absolute symbol for pc-relative fixes to constants. * config/tc-arm.h (TC_FORCE_RELOCATATION_ABS): Define. ld/testsuite/ * ld-arm/abs-call-1.d: New. * ld-arm/abs-call-1.s: New. * ld-arm/arm-elf.exp: Add it.
This commit is contained in:
@ -1,3 +1,10 @@
|
|||||||
|
2011-05-31 Paul Brook <paul@codesourcery.com>
|
||||||
|
Nathan Sidwell <nathan@codesourcery.com>
|
||||||
|
|
||||||
|
* config/tc-arm.c (fix_new_arm): Create an absolute symbol for
|
||||||
|
pc-relative fixes to constants.
|
||||||
|
* config/tc-arm.h (TC_FORCE_RELOCATATION_ABS): Define.
|
||||||
|
|
||||||
2011-05-27 Nick Clifton <nickc@redhat.com>
|
2011-05-27 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
* config/tc-s390.c (md_begin): Remove unused variable dup_insn.
|
* config/tc-s390.c (md_begin): Remove unused variable dup_insn.
|
||||||
|
@ -15434,6 +15434,29 @@ fix_new_arm (fragS * frag,
|
|||||||
switch (exp->X_op)
|
switch (exp->X_op)
|
||||||
{
|
{
|
||||||
case O_constant:
|
case O_constant:
|
||||||
|
if (pc_rel)
|
||||||
|
{
|
||||||
|
/* Create an absolute valued symbol, so we have something to
|
||||||
|
refer to in the object file. Unfortunately for us, gas's
|
||||||
|
generic expression parsing will already have folded out
|
||||||
|
any use of .set foo/.type foo %function that may have
|
||||||
|
been used to set type information of the target location,
|
||||||
|
that's being specified symbolically. We have to presume
|
||||||
|
the user knows what they are doing. */
|
||||||
|
char name[16 + 8];
|
||||||
|
symbolS *symbol;
|
||||||
|
|
||||||
|
sprintf (name, "*ABS*0x%lx", (unsigned long)exp->X_add_number);
|
||||||
|
|
||||||
|
symbol = symbol_find_or_make (name);
|
||||||
|
S_SET_SEGMENT (symbol, absolute_section);
|
||||||
|
symbol_set_frag (symbol, &zero_address_frag);
|
||||||
|
S_SET_VALUE (symbol, exp->X_add_number);
|
||||||
|
exp->X_op = O_symbol;
|
||||||
|
exp->X_add_symbol = symbol;
|
||||||
|
exp->X_add_number = 0;
|
||||||
|
}
|
||||||
|
/* FALLTHROUGH */
|
||||||
case O_symbol:
|
case O_symbol:
|
||||||
case O_add:
|
case O_add:
|
||||||
case O_subtract:
|
case O_subtract:
|
||||||
|
@ -192,6 +192,12 @@ void arm_copy_symbol_attributes (symbolS *, symbolS *);
|
|||||||
(THUMB_IS_FUNC ((FIX)->fx_addsy) \
|
(THUMB_IS_FUNC ((FIX)->fx_addsy) \
|
||||||
|| !SEG_NORMAL (SEG))
|
|| !SEG_NORMAL (SEG))
|
||||||
|
|
||||||
|
#define TC_FORCE_RELOCATION_ABS(FIX) \
|
||||||
|
(((FIX)->fx_pcrel \
|
||||||
|
&& (FIX)->fx_r_type != BFD_RELOC_32 \
|
||||||
|
&& (FIX)->fx_r_type != BFD_RELOC_ARM_GOT32) \
|
||||||
|
|| TC_FORCE_RELOCATION(FIX))
|
||||||
|
|
||||||
#define TC_CONS_FIX_NEW cons_fix_new_arm
|
#define TC_CONS_FIX_NEW cons_fix_new_arm
|
||||||
|
|
||||||
#define MAX_MEM_ALIGNMENT_BYTES 6
|
#define MAX_MEM_ALIGNMENT_BYTES 6
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
2011-05-31 Paul Brook <paul@codesourcery.com>
|
||||||
|
Nathan Sidwell <nathan@codesourcery.com>
|
||||||
|
|
||||||
|
* ld-arm/abs-call-1.d: New.
|
||||||
|
* ld-arm/abs-call-1.s: New.
|
||||||
|
* ld-arm/arm-elf.exp: Add it.
|
||||||
|
|
||||||
2011-05-31 Paul Brook <paul@codesourcery.com>
|
2011-05-31 Paul Brook <paul@codesourcery.com>
|
||||||
|
|
||||||
* ld-arm/tls-longplt.d: Update expected output.
|
* ld-arm/tls-longplt.d: Update expected output.
|
||||||
|
9
ld/testsuite/ld-arm/abs-call-1.d
Normal file
9
ld/testsuite/ld-arm/abs-call-1.d
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
.*: file format elf32-.*
|
||||||
|
|
||||||
|
|
||||||
|
Disassembly of section .text:
|
||||||
|
|
||||||
|
00008000 <arm>:
|
||||||
|
8000: eb03dffe bl 100000 <foo>
|
||||||
|
8004: ea03dffd b 100000 <foo>
|
||||||
|
8008: eb03dffc bl 100000 <foo>
|
8
ld/testsuite/ld-arm/abs-call-1.s
Normal file
8
ld/testsuite/ld-arm/abs-call-1.s
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
.type foo, %function
|
||||||
|
.set foo, 0x100000
|
||||||
|
|
||||||
|
arm: bl 0x100000
|
||||||
|
b 0x100000
|
||||||
|
bl foo
|
||||||
|
|
@ -413,6 +413,9 @@ set armelftests {
|
|||||||
{objdump {-s -j.data -j.got} ifunc-16.gd}
|
{objdump {-s -j.data -j.got} ifunc-16.gd}
|
||||||
{readelf -r ifunc-16.rd}}
|
{readelf -r ifunc-16.rd}}
|
||||||
"ifunc-16"}
|
"ifunc-16"}
|
||||||
|
{"abs call" "-T arm.ld" "" {abs-call-1.s}
|
||||||
|
{{objdump -d abs-call-1.d}}
|
||||||
|
"abs-call-1"}
|
||||||
}
|
}
|
||||||
|
|
||||||
run_ld_link_tests $armelftests
|
run_ld_link_tests $armelftests
|
||||||
|
Reference in New Issue
Block a user