diff options
author | Stafford Horne <shorne@gmail.com> | 2021-04-06 05:47:17 +0900 |
---|---|---|
committer | Stafford Horne <shorne@gmail.com> | 2021-08-15 07:22:58 +0900 |
commit | eff8110674ef193481d3657456a262beeb9951ff (patch) | |
tree | 71adf5ce89c9c912662179f49f2167eaecfec53b /gcc/doc | |
parent | 96194a07bdbc57dd9733892a791d87dbe25f0802 (diff) | |
download | gcc-eff8110674ef193481d3657456a262beeb9951ff.zip gcc-eff8110674ef193481d3657456a262beeb9951ff.tar.gz gcc-eff8110674ef193481d3657456a262beeb9951ff.tar.bz2 |
or1k: Add mcmodel option to handle large GOTs
When building libgeos we get an error with:
linux-uclibc/9.3.0/crtbeginS.o: in function `__do_global_dtors_aux':
crtstuff.c:(.text+0x118): relocation truncated to fit: R_OR1K_GOT16 against symbol `__cxa_finalize' defined in .text section in
/home/shorne/work/openrisc/3eb9f9d0f6d8274b2d19753c006bd83f7d536e3c/output/host/or1k-buildroot-linux-uclibc/sysroot/lib/libc.so.
This is caused by GOT code having a limit of 64k. In OpenRISC this
looks to be the only relocation code pattern to be limited to 64k.
This patch allows specifying a new option -mcmodel=large which can be
used to generate 2 more instructions to construct 32-bit addresses for
up to 4G GOTs.
gcc/ChangeLog:
PR target/99783
* config/or1k/or1k-opts.h: New file.
* config/or1k/or1k.c (or1k_legitimize_address_1, print_reloc):
Support generating gotha relocations if -mcmodel=large is
specified.
* config/or1k/or1k.h (TARGET_CMODEL_SMALL, TARGET_CMODEL_LARGE):
New macros.
* config/or1k/or1k.opt (mcmodel=): New option.
* doc/invoke.texi (OpenRISC Options): Document mcmodel.
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/invoke.texi | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 57b97a0..d8a6b0b 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -1141,7 +1141,8 @@ Objective-C and Objective-C++ Dialects}. @gccoptlist{-mboard=@var{name} -mnewlib -mhard-mul -mhard-div @gol -msoft-mul -msoft-div @gol -msoft-float -mhard-float -mdouble-float -munordered-float @gol --mcmov -mror -mrori -msext -msfimm -mshftimm} +-mcmov -mror -mrori -msext -msfimm -mshftimm @gol +-mcmodel=@var{code-model}} @emph{PDP-11 Options} @gccoptlist{-mfpu -msoft-float -mac0 -mno-ac0 -m40 -m45 -m10 @gol @@ -26684,6 +26685,15 @@ Enable generation of shift with immediate (@code{l.srai}, @code{l.srli}, @code{l.slli}) instructions. By default extra instructions will be generated to store the immediate to a register first. +@item -mcmodel=small +@opindex mcmodel=small +Generate OpenRISC code for the small model: The GOT is limited to 64k. This is +the default model. + +@item -mcmodel=large +@opindex mcmodel=large +Generate OpenRISC code for the large model: The GOT may grow up to 4G in size. + @end table |