aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorAndrew Sadek <andrew.sadek.se@gmail.com>2018-04-30 11:16:55 +0000
committerMichael Eager <eager@gcc.gnu.org>2018-04-30 11:16:55 +0000
commitaf1682fc3aaff288f7ac95cf5585971cef15f0ab (patch)
treea18a830cd4148874dcac4c70eb18dd4b43f54a1b /gcc/doc
parent5885f02733f9bab7e9508bfebbeed5b3c9254aaa (diff)
downloadgcc-af1682fc3aaff288f7ac95cf5585971cef15f0ab.zip
gcc-af1682fc3aaff288f7ac95cf5585971cef15f0ab.tar.gz
gcc-af1682fc3aaff288f7ac95cf5585971cef15f0ab.tar.bz2
Microblaze Target: PIC data text relative
2018-04-30 Andrew Sadek <andrew.sadek.se@gmail.com> gcc/ChangeLog: * config/microblaze/microblaze.opt: add new option -mpic-data-text-rel. * config/microblaze/microblaze-protos.h (microblaze_constant_address_p): Add declaration. * gcc/config/microblaze/microblaze.h (microblaze_constant_address_p): CONSTANT_ADDRESS_P definition to microblaze_constant_address_p. * config/microblaze/microblaze.c (TARGET_PIC_DATA_TEXT_REL): New addressing mode for data-text relative position indepenedent code. (microblaze_classify_unspec): add 'UNSPEC_TEXT' case -> 'ADDRESS_SYMBOLIC_TXT_REL'. (microblaze_classify_address): Add handling for UNSPEC + CONST_INT. (microblaze_legitimate_pic_operand): Exclude function calls from pic operands in case of TARGET_PIC_DATA_TEXT_REL option. (microblaze_legitimize_address): Generate 'UNSPEC_TEXT' for all possible addresses cases. (microblaze_address_insns): Add 'ADDRESS_SYMBOLIC_TXT_REL' case. (print_operand): Add 'ADDRESS_SYMBOLIC_TXT_REL' case. (print_operand_address): Add 'ADDRESS_SYMBOLIC_TXT_REL' case + handling for 'address + offset'. (microblaze_expand_prologue): Add new function prologue call for 'r20' assignation. (microblaze_asm_generate_pic_addr_dif_vec): Override new target hook 'TARGET_ASM_GENERATE_PIC_ADDR_DIFF_VEC' to disable address diff vector table in case of TARGET_PIC_DATA_TEXT_REL. (expand_pic_symbol_ref): Add handling for 'UNSPEC_TEXT'. * gcc/config/microblaze/microblaze.md (TARGET_PIC_DATA_TEXT_REL): Add new macros 'UNSPEC_TEXT', 'UNSPEC_SET_TEXT' + add rule for setting r20 in function prologue + exclude function calls from 'UNSPEC_PLT' in case of data text relative mode. * doc/tm.texi.in (TARGET_ASM_GENERATE_PIC_ADDR_DIFF_VEC): Add new target hook for generating address diff vector tables in case of flag_pic. * doc/tm.texi : Regenerate. * stmt.c (TARGET_ASM_GENERATE_PIC_ADDR_DIFF_VEC): Append new condition 'targetm.asm_out.generate_pic_addr_diff_vec' to flag_pic in case of addr diff vector generation. * target.def (TARGET_ASM_GENERATE_PIC_ADDR_DIFF_VEC): Add target hook definition. * targhooks.h, gcc/targhooks.c (TARGET_ASM_GENERATE_PIC_ADDR_DIFF_VEC): Add default function for generate_pic_addr_diff_vec -> flag_pic. * doc/invoke.texi (Add new pic option): Add new microblaze pic option for data text relative. testsuite/ChangeLog: * gcc.target/microblaze/others/data_var1.c: Include PIC case of r20 base register. * gcc.target/microblaze/others/data_var2.c: Ditto. * gcc.target/microblaze/others/picdtr.c: Add new test case for -mpic-is-data-text-relative. * gcc.target/microblaze/others/sdata_var1.c: Add * gcc.target/microblaze/others/sdata_var2.c: Ditto. * gcc.target/microblaze/others/sdata_var3.c: Ditto. * gcc.target/microblaze/others/sdata_var4.c: Ditto. * gcc.target/microblaze/others/sdata_var5.c: Ditto. * gcc.target/microblaze/others/sdata_var6.c: Ditto. * gcc.target/microblaze/others/string_cst1_gpopt.c: Ditto. * gcc.target/microblaze/others/string_cst2_gpopt.c: Ditto. From-SVN: r259758
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/invoke.texi9
-rw-r--r--gcc/doc/tm.texi8
-rw-r--r--gcc/doc/tm.texi.in2
3 files changed, 18 insertions, 1 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 4441591..e45f467 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -867,7 +867,8 @@ Objective-C and Objective-C++ Dialects}.
-mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift @gol
-mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss @gol
-mxl-multiply-high -mxl-float-convert -mxl-float-sqrt @gol
--mbig-endian -mlittle-endian -mxl-reorder -mxl-mode-@var{app-model}}
+-mbig-endian -mlittle-endian -mxl-reorder -mxl-mode-@var{app-model}
+-mpic-data-is-text-relative}
@emph{MIPS Options}
@gccoptlist{-EL -EB -march=@var{arch} -mtune=@var{arch} @gol
@@ -20113,6 +20114,12 @@ Select application model @var{app-model}. Valid models are
@item executable
normal executable (default), uses startup code @file{crt0.o}.
+@item -mpic-data-is-text-relative
+@opindex mpic-data-is-text-relative
+Assume that the displacement between the text and data segments is fixed
+at static link time. This allows data to be referenced by offset from start of
+text address instead of GOT since PC-relative addressing is not supported.
+
@item xmdstub
for use with Xilinx Microprocessor Debugger (XMD) based
software intrusive debug agent called xmdstub. This uses startup file
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index bd8b917..9d92ed1 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -7491,6 +7491,14 @@ when the target cannot support (some kinds of) dynamic relocations
in read-only sections even in executables.
@end deftypefn
+@deftypefn {Target Hook} bool TARGET_ASM_GENERATE_PIC_ADDR_DIFF_VEC (void)
+Return true to generate ADDR_DIF_VEC table
+or false to generate ADDR_VEC table for jumps in case of -fPIC.
+
+The default version of this function returns true if flag_pic
+equals true and false otherwise
+@end deftypefn
+
@deftypefn {Target Hook} {section *} TARGET_ASM_SELECT_SECTION (tree @var{exp}, int @var{reloc}, unsigned HOST_WIDE_INT @var{align})
Return the section into which @var{exp} should be placed. You can
assume that @var{exp} is either a @code{VAR_DECL} node or a constant of
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index b020714..5732a2a 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -4922,6 +4922,8 @@ This macro is irrelevant if there is no separate readonly data section.
@hook TARGET_ASM_RELOC_RW_MASK
+@hook TARGET_ASM_GENERATE_PIC_ADDR_DIFF_VEC
+
@hook TARGET_ASM_SELECT_SECTION
@defmac USE_SELECT_SECTION_FOR_FUNCTIONS