aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@gcc.gnu.org>2006-03-22 07:21:00 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2006-03-22 07:21:00 +0000
commit567b3b825767d85837c2f6e12bbe70d45a664635 (patch)
tree5f4e2cd734a0c944823b6faa4c2e928ce4a0a32f
parent0c5a42a660c636a39d6cfb73e0b2a1bc6552509b (diff)
downloadgcc-567b3b825767d85837c2f6e12bbe70d45a664635.zip
gcc-567b3b825767d85837c2f6e12bbe70d45a664635.tar.gz
gcc-567b3b825767d85837c2f6e12bbe70d45a664635.tar.bz2
predicates.md (const_call_insn_operand): Allow direct calls to locally-defined functions if TARGET_ABSOLUTE_ABICALLS.
* config/mips/predicates.md (const_call_insn_operand): Allow direct calls to locally-defined functions if TARGET_ABSOLUTE_ABICALLS. * config/mips/mips.md (jal_macro): Test TARGET_ABSOLUTE_ABICALLS. Use TARGET_OLDABI instead of !TARGET_NEWABI. (loadgp): Use mips_current_loadgp_style. (loadgp_noshared): New pattern. (sibcall_internal): Use MIPS_CALL. (sibcall_value_internal): Likewise. (sibcall_value_multiple_internal): Likewise. (call_internal): Likewise. (call_value_internal): Likewise. (call_value_multiple_internal): Likewise. (call_split): Use MIPS_CALL and add an 'S' constraint. (call_value_split): Likewise. (call_value_multiple_split): Likewise. * config/mips/mips.opt (-mabicalls): Tweak docstring. (-mshared): New option. * config/mips/mips-protos.h (mips_loadgp_style): New enum. (mips_current_loadgp_style): Declare. * config/mips/mips.c (mips_classify_symbol): Avoid using SYMBOL_GOT_LOCAL if TARGET_ABSOLUTE_ABICALLS. Use SYMBOL_GENERAL rather than SYMBOL_GOT_GLOBAL for locally-binding symbols if TARGET_ABSOLUTE_ABICALLS. (override_options): Adjust comments. Improve the warning that is issued when -mabicalls and -G are used together. (mips_file_start): Remove comment. (mips_current_loadgp_style): New function. (mips_gnu_local_gp): New variable. (mips_emit_loadgp): Use mips_current_loadgp_style. Handle LOADGP_ABSOLUTE. (mips_output_function_prologue): Use mips_current_laodgp_style. (mips_expand_prologue): Call mips_emit_loadgp before emitting the cprestore instruction. (mips_extra_live_on_entry): Fix reversed test. Don't make $25 live for TARGET_ABSOLUTE_ABICALLS. * config/mips/mips.h (TARGET_ABSOLUTE_ABICALLS): New macro. (ASM_SPEC): Pass down -mshared and -mno-shared. (MIPS_CALL): New macro. * config/mips/netbsd.h (TARGET_OS_CPP_BUILTINS): Remove __ABICALLS__ definition. * doc/invoke.texi (-mabicalls): Update documentation. (-mshared): Document. From-SVN: r112279
-rw-r--r--gcc/doc/invoke.texi31
1 files changed, 26 insertions, 5 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index a67d663..1a26929 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -596,9 +596,9 @@ Objective-C and Objective-C++ Dialects}.
@gccoptlist{-EL -EB -march=@var{arch} -mtune=@var{arch} @gol
-mips1 -mips2 -mips3 -mips4 -mips32 -mips32r2 -mips64 @gol
-mips16 -mno-mips16 -mabi=@var{abi} -mabicalls -mno-abicalls @gol
--mxgot -mno-xgot -mgp32 -mgp64 -mfp32 -mfp64 @gol
--mhard-float -msoft-float -msingle-float -mdouble-float @gol
--mdsp -mpaired-single -mips3d @gol
+-mshared -mno-shared -mxgot -mno-xgot -mgp32 -mgp64 @gol
+-mfp32 -mfp64 -mhard-float -msoft-float @gol
+-msingle-float -mdouble-float -mdsp -mpaired-single -mips3d @gol
-mlong64 -mlong32 -msym32 -mno-sym32 @gol
-G@var{num} -membedded-data -mno-embedded-data @gol
-muninit-const-in-rodata -mno-uninit-const-in-rodata @gol
@@ -10464,8 +10464,29 @@ For information about the O64 ABI, see
@itemx -mno-abicalls
@opindex mabicalls
@opindex mno-abicalls
-Generate (do not generate) SVR4-style position-independent code.
-@option{-mabicalls} is the default for SVR4-based systems.
+Generate (do not generate) code that is suitable for SVR4-style
+dynamic objects. @option{-mabicalls} is the default for SVR4-based
+systems.
+
+@item -mshared
+@itemx -mno-shared
+Generate (do not generate) code that is fully position-independent.
+This option only affects @option{-mabicalls}.
+
+All @option{-mabicalls} code has traditionally been position-independent,
+regardless of options like @option{-fPIC} and @option{-fpic}. However,
+as an extension, the GNU toolchain allows executables to use absolute
+accesses for locally-binding symbols. It can also use shorter GP
+initialization sequences and generate direct calls to locally-defined
+functions. This mode is selected by @option{-mno-shared}.
+
+@option{-mno-shared} depends on binutils 2.16 or higher and generates
+objects that can only be linked by the GNU linker. However, the option
+does not affect the ABI of the final executable; it only affects the ABI
+of relocatable objects. Using @option{-mno-shared} will generally make
+executables both smaller and quicker.
+
+@option{-mshared} is the default.
@item -mxgot
@itemx -mno-xgot