diff options
author | YunQiang Su <syq@gcc.gnu.org> | 2024-01-19 18:23:21 +0800 |
---|---|---|
committer | YunQiang Su <syq@gcc.gnu.org> | 2024-01-24 20:33:42 +0800 |
commit | 58af788d1d0825187def434c95cab35a690a31b0 (patch) | |
tree | 7c1744800b85c10cc4a1411bfc0e439d20c4eefe /gcc/config/mips/mips.h | |
parent | 7fcdb501366632fbf98a1eff275d76b9eea91aa1 (diff) | |
download | gcc-58af788d1d0825187def434c95cab35a690a31b0.zip gcc-58af788d1d0825187def434c95cab35a690a31b0.tar.gz gcc-58af788d1d0825187def434c95cab35a690a31b0.tar.bz2 |
MIPS: Accept arguments for -mexplicit-relocs
GAS introduced explicit relocs since 2001, and %pcrel_hi/low were
introduced in 2014. In future, we may introduce more.
Let's convert -mexplicit-relocs option, and accpet options:
none, base, pcrel.
We also update gcc/configure.ac to set the value to option
the gas support when GCC itself is built.
gcc
* configure.ac: Detect the explicit relocs support for
mips, and define C macro MIPS_EXPLICIT_RELOCS.
* config.in: Regenerated.
* configure: Regenerated.
* doc/invoke.texi(MIPS Options): Add -mexplicit-relocs.
* config/mips/mips-opts.h: Define enum mips_explicit_relocs.
* config/mips/mips.cc(mips_set_compression_mode): Sorry if
!TARGET_EXPLICIT_RELOCS instead of just set it.
* config/mips/mips.h: Define TARGET_EXPLICIT_RELOCS and
TARGET_EXPLICIT_RELOCS_PCREL with mips_opt_explicit_relocs.
* config/mips/mips.opt: Introduce -mexplicit-relocs= option
and define -m(no-)explicit-relocs as aliases.
Diffstat (limited to 'gcc/config/mips/mips.h')
-rw-r--r-- | gcc/config/mips/mips.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index 8768933..7145d23 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -145,6 +145,14 @@ struct mips_cpu_info { || TARGET_MICROMIPS) \ && mips_cb != MIPS_CB_NEVER) +/* True if assembler support %gp_rel etc. */ +#define TARGET_EXPLICIT_RELOCS \ + (mips_opt_explicit_relocs >= MIPS_EXPLICIT_RELOCS_BASE) + +/* True if assembler support %pcrel_hi/%pcrel_lo. */ +#define TARGET_EXPLICIT_RELOCS_PCREL \ + (mips_opt_explicit_relocs >= MIPS_EXPLICIT_RELOCS_PCREL) + /* True if the output file is marked as ".abicalls; .option pic0" (-call_nonpic). */ #define TARGET_ABICALLS_PIC0 \ |