diff options
author | Andre Vieira <andre.simoesdiasvieira@arm.com> | 2016-09-22 17:02:47 +0000 |
---|---|---|
committer | Andre Vieira <avieira@gcc.gnu.org> | 2016-09-22 17:02:47 +0000 |
commit | 0ee70cc0000fe25484cb0d3b2ac2904d2007e5cf (patch) | |
tree | 2b6549bc452c8fe8fec854d66c6c770e37be25f7 /gcc/doc | |
parent | 31e9f857d5408a69bc6c1eac793103c73ce6eed0 (diff) | |
download | gcc-0ee70cc0000fe25484cb0d3b2ac2904d2007e5cf.zip gcc-0ee70cc0000fe25484cb0d3b2ac2904d2007e5cf.tar.gz gcc-0ee70cc0000fe25484cb0d3b2ac2904d2007e5cf.tar.bz2 |
[ARM] Add support for -mpure-code option
gcc/ChangeLog:
2016-09-22 Andre Vieira <andre.simoesdiasvieira@arm.com>
Terry Guo <terry.guo@arm.com>
* target.def (elf_flags_numeric): New target hook.
* targhooks.h (default_asm_elf_flags_numeric): New.
* varasm.c (default_asm_elf_flags_numeric): New.
(default_elf_asm_named_section): Use new target hook.
* config/arm/arm.opt (mpure-code): New.
* config/arm/arm.h (SECTION_ARM_PURECODE): New.
* config/arm/arm.c (arm_asm_init_sections): Add section
attribute to default text section if -mpure-code.
(arm_option_check_internal): Diagnose use of option with
non supported targets and/or options.
(arm_asm_elf_flags_numeric): New.
(arm_function_section): New.
(arm_elf_section_type_flags): New.
* config/arm/elf.h (JUMP_TABLES_IN_TEXT_SECTION): Disable
for -mpure-code.
* gcc/doc/texi (TARGET_ASM_ELF_FLAGS_NUMERIC): New.
* gcc/doc/texi.in (TARGET_ASM_ELF_FLAGS_NUMERIC): Likewise.
gcc/testsuite/ChangeLog:
2016-09-22 Andre Vieira <andre.simoesdiasvieira@arm.com>
Terry Guo <terry.guo@arm.com>
* gcc.target/arm/pure-code/ffunction-sections.c: New.
* gcc.target/arm/pure-code/no-literal-pool.c: New.
* gcc.target/arm/pure-code/pure-code.exp: New.
Co-Authored-By: Terry Guo <terry.guo@arm.com>
From-SVN: r240379
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/invoke.texi | 11 | ||||
-rw-r--r-- | gcc/doc/tm.texi | 12 | ||||
-rw-r--r-- | gcc/doc/tm.texi.in | 2 |
3 files changed, 24 insertions, 1 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index cfba069..d474da6 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -641,7 +641,8 @@ Objective-C and Objective-C++ Dialects}. -mneon-for-64bits @gol -mslow-flash-data @gol -masm-syntax-unified @gol --mrestrict-it} +-mrestrict-it @gol +-mpure-code} @emph{AVR Options} @gccoptlist{-mmcu=@var{mcu} -maccumulate-args -mbranch-cost=@var{cost} @gol @@ -14844,6 +14845,14 @@ Print CPU tuning information as comment in assembler file. This is an option used only for regression testing of the compiler and not intended for ordinary use in compiling code. This option is disabled by default. + +@item -mpure-code +@opindex mpure-code +Do not allow constant data to be placed in code sections. +Additionally, when compiling for ELF object format give all text sections the +ELF processor-specific section attribute @code{SHF_ARM_PURECODE}. This option +is only available when generating non-pic code for ARMv7-M targets. + @end table @node AVR Options diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 61d3a67..68a77e8 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -7568,6 +7568,18 @@ is non-NULL, it is the @code{VAR_DECL} or @code{FUNCTION_DECL} with which this section is associated. @end deftypefn +@deftypefn {Target Hook} bool TARGET_ASM_ELF_FLAGS_NUMERIC (unsigned int @var{flags}, unsigned int *@var{num}) +This hook can be used to encode ELF section flags for which no letter +code has been defined in the assembler. It is called by +@code{default_asm_named_section} whenever the section flags need to be +emitted in the assembler output. If the hook returns true, then the +numerical value for ELF section flags should be calculated from +@var{flags} and saved in @var{*num}; the value will be printed out +instead of the normal sequence of letter codes. If the hook is not +defined, or if it returns false, then @var{num} will be ignored and the +traditional letter sequence will be emitted. +@end deftypefn + @deftypefn {Target Hook} {section *} TARGET_ASM_FUNCTION_SECTION (tree @var{decl}, enum node_frequency @var{freq}, bool @var{startup}, bool @var{exit}) Return preferred text (sub)section for function @var{decl}. Main purpose of this function is to separate cold, normal and hot diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index fd3d65d..f1cfc86 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -5219,6 +5219,8 @@ of the filename using this macro. @hook TARGET_ASM_NAMED_SECTION +@hook TARGET_ASM_ELF_FLAGS_NUMERIC + @hook TARGET_ASM_FUNCTION_SECTION @hook TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS |