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/target.def | |
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/target.def')
-rw-r--r-- | gcc/target.def | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/target.def b/gcc/target.def index 33acc79..ac69331 100644 --- a/gcc/target.def +++ b/gcc/target.def @@ -432,6 +432,22 @@ this section is associated.", void, (const char *name, unsigned int flags, tree decl), default_no_named_section) +/* Tell assembler what section attributes to assign this elf section + declaration, using their numerical value. */ +DEFHOOK +(elf_flags_numeric, + "This hook can be used to encode ELF section flags for which no letter\n\ +code has been defined in the assembler. It is called by\n\ +@code{default_asm_named_section} whenever the section flags need to be\n\ +emitted in the assembler output. If the hook returns true, then the\n\ +numerical value for ELF section flags should be calculated from\n\ +@var{flags} and saved in @var{*num}; the value will be printed out\n\ +instead of the normal sequence of letter codes. If the hook is not\n\ +defined, or if it returns false, then @var{num} will be ignored and the\n\ +traditional letter sequence will be emitted.", + bool, (unsigned int flags, unsigned int *num), + hook_uint_uintp_false) + /* Return preferred text (sub)section for function DECL. Main purpose of this function is to separate cold, normal and hot functions. STARTUP is true when function is known to be used only |