diff options
author | Alan Modra <amodra@gmail.com> | 2017-05-16 08:43:24 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2017-05-16 10:35:02 +0930 |
commit | 91cb9803fcf6d1c7001395d80f79120ae8e6338a (patch) | |
tree | 76ce1a1640c62ee9b78e692e1e41b8a1abd67ccf /gas/config/tc-mn10300.h | |
parent | bc4e12ded1d4c8d589d82b2a10ade6b47f219db3 (diff) | |
download | gdb-91cb9803fcf6d1c7001395d80f79120ae8e6338a.zip gdb-91cb9803fcf6d1c7001395d80f79120ae8e6338a.tar.gz gdb-91cb9803fcf6d1c7001395d80f79120ae8e6338a.tar.bz2 |
Allow target files access to default TC_FORCE_RELOCATION defines
* write.c (GENERIC_FORCE_RELOCATION_LOCAL): Define.
(TC_FORCE_RELOCATION_LOCAL): Use it.
(GENERIC_FORCE_RELOCATION_SUB_SAME): Define.
(TC_FORCE_RELOCATION_SUB_SAME): Use it.
* config/tc-arm.h (TC_FORCE_RELOCATION_LOCAL,
TC_FORCE_RELOCATION_SUB_SAME): Use GENERIC defines.
* config/tc-aarch64.h: Similarly.
* config/tc-avr.h: Similarly.
* config/tc-cris.h: Similarly.
* config/tc-i386.h: Similarly.
* config/tc-i960.h: Similarly.
* config/tc-ia64.h: Similarly.
* config/tc-microblaze.h: Similarly.
* config/tc-mips.h: Similarly.
* config/tc-msp430.h: Similarly.
* config/tc-nds32.h: Similarly.
* config/tc-pru.h: Similarly.
* config/tc-riscv.h: Similarly.
* config/tc-rl78.h: Similarly.
* config/tc-s390.h: Similarly.
* config/tc-sh.h: Similarly.
* config/tc-sh64.h: Similarly.
* config/tc-sparc.h: Similarly.
* config/tc-xtensa.h: Similarly.
* config/tc-mn10300.h: Similarly.
(GENERIC_FORCE_RELOCATION_LOCAL): Define.
* config/tc-msp430.c (msp430_force_relocation_local): Modify to
be addition to rather than replacement of standard
TC_FORCE_RELOCATION_LOCAL.
Diffstat (limited to 'gas/config/tc-mn10300.h')
-rw-r--r-- | gas/config/tc-mn10300.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/gas/config/tc-mn10300.h b/gas/config/tc-mn10300.h index e1d3faa..ff39646 100644 --- a/gas/config/tc-mn10300.h +++ b/gas/config/tc-mn10300.h @@ -28,12 +28,20 @@ #define TC_FORCE_RELOCATION(FIX) mn10300_force_relocation (FIX) extern bfd_boolean mn10300_force_relocation (struct fix *); +/* tc-mn10300.c uses TC_FORCE_RELOCATION_LOCAL, a macro that should + only appear in write.c. The use is likely incorrect. Duplicating + the definition here rather than expanding it in + TC_FORCE_RELOCATION_LOCAL at least ensures write.c changes will be + flagged immediately with a compile error. */ +#define GENERIC_FORCE_RELOCATION_LOCAL(FIX) \ + (!(FIX)->fx_pcrel \ + || TC_FORCE_RELOCATION (FIX)) + #define TC_FORCE_RELOCATION_LOCAL(FIX) \ - (!(FIX)->fx_pcrel \ + (GENERIC_FORCE_RELOCATION_LOCAL (FIX) \ || (FIX)->fx_r_type == BFD_RELOC_32_PLT_PCREL \ || (FIX)->fx_r_type == BFD_RELOC_MN10300_GOT32 \ - || (FIX)->fx_r_type == BFD_RELOC_32_GOT_PCREL \ - || TC_FORCE_RELOCATION (FIX)) + || (FIX)->fx_r_type == BFD_RELOC_32_GOT_PCREL) #define md_parse_name(NAME, EXPRP, MODE, NEXTCHARP) \ mn10300_parse_name ((NAME), (EXPRP), (MODE), (NEXTCHARP)) @@ -63,8 +71,8 @@ void mn10300_cons_fix_new (fragS *, int, int, expressionS *, linker, but this fix is simpler, and it pretty much only affects object size a little bit. */ #define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEC) \ - (((SEC)->flags & SEC_CODE) != 0 \ - || ! SEG_NORMAL (SEC) \ + (GENERIC_FORCE_RELOCATION_SUB_SAME (FIX, SEC) \ + || ((SEC)->flags & SEC_CODE) != 0 \ || (FIX)->fx_r_type == BFD_RELOC_MN10300_ALIGN \ || TC_FORCE_RELOCATION (FIX)) |