diff options
author | Paul Brook <paul@codesourcery.com> | 2011-05-31 13:40:04 +0000 |
---|---|---|
committer | Paul Brook <paul@codesourcery.com> | 2011-05-31 13:40:04 +0000 |
commit | 6e7ce2cdd34f7e3ad720e1d43a19635d79ce17b4 (patch) | |
tree | d8a159765825d07d54e8c5480dff705e6d356b1f /gas/config/tc-arm.c | |
parent | 12352d3f854285aaaecf6bc89df80e6247968a63 (diff) | |
download | gdb-6e7ce2cdd34f7e3ad720e1d43a19635d79ce17b4.zip gdb-6e7ce2cdd34f7e3ad720e1d43a19635d79ce17b4.tar.gz gdb-6e7ce2cdd34f7e3ad720e1d43a19635d79ce17b4.tar.bz2 |
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.
Diffstat (limited to 'gas/config/tc-arm.c')
-rw-r--r-- | gas/config/tc-arm.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index a9839cd..375ff82 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -15434,6 +15434,29 @@ fix_new_arm (fragS * frag, switch (exp->X_op) { 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_add: case O_subtract: |