aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorMickael Guene <mickael.guene@st.com>2016-01-20 12:53:50 +0000
committerNick Clifton <nickc@redhat.com>2016-01-20 12:53:50 +0000
commit91f68a68f992e3f6c3da26c616b5257230bd1eec (patch)
tree9e549da0d8aaacafb6231069425241f003357a14 /gas/config
parentbe56871ee8f65c51b9eee611532ed036a71a72e0 (diff)
downloadgdb-91f68a68f992e3f6c3da26c616b5257230bd1eec.zip
gdb-91f68a68f992e3f6c3da26c616b5257230bd1eec.tar.gz
gdb-91f68a68f992e3f6c3da26c616b5257230bd1eec.tar.bz2
Add support for an ARM specific 'y' section attribute flag to mark the section as NOREAD.
bfd/ChangeLog: * elf32-arm.c ((elf32_arm_special_sections): Remove catch of noread section using '.text.noread' pattern. gas/ChangeLog: * config/obj-elf.c (obj_elf_change_section) : Allow arm section with SHF_ARM_NOREAD section flag. * config/tc-arm.h (md_elf_section_letter) : Implement this hook to handle letter 'y'. (arm_elf_section_letter) : Declare it. * config/tc-arm.c (arm_elf_section_letter): Handle letter 'y' to set SHF_ARM_NOREAD section flag. * doc/c-arm.texi (ARM section attribute 'y'): Document it. gas/testsuite/ChangeLog: * gas/arm/section-execute-only.s: New test case. * gas/arm/section-execute-only.d: Expected output. ld/testsuite/ChangeLog: * ld-arm/thumb1-noread-not-present-mixing-two-section.s: Add 'y' attribute usage. * ld-arm/thumb1-noread-present-one-section.s: Likewise. * ld-arm/thumb1-noread-present-two-section.s: Likewise. * ld-arm/thumb1-input-section-flag-match.s: Likewise. binutils/ChangeLog: * readelf.c (get_elf_section_flags): Display y letter for section with SHF_ARM_NOREAD section flag in readelf section output. (process_section_headers): Add y letter in readelf section output key mapping for ARM architecture.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/obj-elf.c9
-rw-r--r--gas/config/tc-arm.c9
-rw-r--r--gas/config/tc-arm.h3
3 files changed, 21 insertions, 0 deletions
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
index f4726ff..6d6d5f3 100644
--- a/gas/config/obj-elf.c
+++ b/gas/config/obj-elf.c
@@ -64,6 +64,10 @@
#include "elf/nios2.h"
#endif
+#ifdef TC_ARM
+#include "elf/arm.h"
+#endif
+
static void obj_elf_line (int);
static void obj_elf_size (int);
static void obj_elf_type (int);
@@ -674,6 +678,11 @@ obj_elf_change_section (const char *name,
/* RX init/fini arrays can and should have the "awx" attributes set. */
;
#endif
+#ifdef TC_ARM
+ else if (attr == (SHF_EXECINSTR | SHF_ARM_NOREAD | SHF_ALLOC))
+ /* ARM can have code section with SHF_ARM_NOREAD attribute. */
+ ;
+#endif
else
{
if (group_name == NULL)
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 046abe5..4a16267 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -24091,6 +24091,15 @@ arm_fix_adjustable (fixS * fixP)
#endif /* defined (OBJ_ELF) || defined (OBJ_COFF) */
#ifdef OBJ_ELF
+bfd_vma
+arm_elf_section_letter (int letter, char **ptrmsg)
+{
+ if (letter == 'y')
+ return SHF_ARM_NOREAD;
+
+ *ptrmsg = _("unrecognized .section attribute: want a,e,w,x,y,M,S,G,T");
+ return -1;
+}
const char *
elf32_arm_target_format (void)
diff --git a/gas/config/tc-arm.h b/gas/config/tc-arm.h
index 319b2c2..749629c 100644
--- a/gas/config/tc-arm.h
+++ b/gas/config/tc-arm.h
@@ -114,6 +114,9 @@ extern bfd_boolean tc_start_label_without_colon (void);
#define tc_frob_fake_label(S) arm_frob_label (S)
#ifdef OBJ_ELF
+#define md_elf_section_letter arm_elf_section_letter
+extern bfd_vma arm_elf_section_letter (int, char **);
+
#define md_end arm_md_end
extern void arm_md_end (void);
bfd_boolean arm_is_eabi (void);