aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
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/testsuite
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/testsuite')
-rw-r--r--gas/testsuite/gas/arm/section-execute-only.d27
-rw-r--r--gas/testsuite/gas/arm/section-execute-only.s30
2 files changed, 57 insertions, 0 deletions
diff --git a/gas/testsuite/gas/arm/section-execute-only.d b/gas/testsuite/gas/arm/section-execute-only.d
new file mode 100644
index 0000000..d45a132
--- /dev/null
+++ b/gas/testsuite/gas/arm/section-execute-only.d
@@ -0,0 +1,27 @@
+# name: test executable-only section attribute
+# as:
+# readelf: -t
+# This test is only valid on EABI based ports.
+# target: *-*-*eabi* *-*-nacl*
+There are 10 section headers, starting at offset 0x16c:
+
+Section Headers:
+ \[Nr\] Name
+ Type Addr Off Size ES Lk Inf Al
+ Flags
+ \[ 0\]
+ NULL 00000000 000000 000000 00 0 0 0
+ \[00000000\]:
+ \[ 1\] .text
+ PROGBITS 00000000 000034 000000 00 0 0 2
+ \[00000006\]: ALLOC, EXEC
+ \[ 2\] .data
+ PROGBITS 00000000 000034 000000 00 0 0 1
+ \[00000003\]: WRITE, ALLOC
+ \[ 3\] .bss
+ NOBITS 00000000 000034 000000 00 0 0 1
+ \[00000003\]: WRITE, ALLOC
+ \[ 4\] .text.foo
+ PROGBITS 00000000 000034 000010 00 0 0 4
+ \[20000006\]: ALLOC, EXEC, ARM_NOREAD
+#pass
diff --git a/gas/testsuite/gas/arm/section-execute-only.s b/gas/testsuite/gas/arm/section-execute-only.s
new file mode 100644
index 0000000..9d5ffc6
--- /dev/null
+++ b/gas/testsuite/gas/arm/section-execute-only.s
@@ -0,0 +1,30 @@
+ .syntax unified
+ .cpu cortex-m3
+ .fpu softvfp
+ .eabi_attribute 20, 1
+ .eabi_attribute 21, 1
+ .eabi_attribute 23, 3
+ .eabi_attribute 24, 1
+ .eabi_attribute 25, 1
+ .eabi_attribute 26, 1
+ .eabi_attribute 30, 2
+ .eabi_attribute 34, 1
+ .eabi_attribute 18, 4
+ .thumb
+ .section .text.foo,"axy",%progbits
+ .align 2
+ .global foo
+ .thumb
+ .thumb_func
+ .type foo, %function
+foo:
+ @ args = 0, pretend = 0, frame = 0
+ @ frame_needed = 0, uses_anonymous_args = 0
+ @ link register save eliminated.
+ movs r0, #1
+ movs r1, #1
+ movw r2, #257
+ movs r3, #1
+ b madd
+ .size foo, .-foo
+