diff options
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/ChangeLog | 10 | ||||
-rw-r--r-- | binutils/readelf.c | 11 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/i386/shstk.d | 9 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/i386/shstk.s | 27 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/x86-64/shstk-x32.d | 10 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/x86-64/shstk.d | 9 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/x86-64/shstk.s | 27 |
7 files changed, 103 insertions, 0 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 3870711..484632a 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,5 +1,15 @@ 2017-06-22 H.J. Lu <hongjiu.lu@intel.com> + * readelf.c (decode_x86_feature): Decode + GNU_PROPERTY_X86_FEATURE_1_SHSTK. + * testsuite/binutils-all/i386/shstk.d: New file. + * testsuite/binutils-all/i386/shstk.s: Likewise. + * testsuite/binutils-all/x86-64/shstk-x32.d: Likewise. + * testsuite/binutils-all/x86-64/shstk.d: Likewise. + * testsuite/binutils-all/x86-64/shstk.s: Likewise. + +2017-06-22 H.J. Lu <hongjiu.lu@intel.com> + * readelf.c (decode_x86_feature): New. (print_gnu_property_note): Call decode_x86_feature on GNU_PROPERTY_X86_FEATURE_1_AND. diff --git a/binutils/readelf.c b/binutils/readelf.c index 50354c1..d23a020 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -16358,6 +16358,17 @@ decode_x86_feature (unsigned int type, unsigned int bitmask) abort (); } break; + case GNU_PROPERTY_X86_FEATURE_1_SHSTK: + switch (type) + { + case GNU_PROPERTY_X86_FEATURE_1_AND: + printf ("SHSTK"); + break; + default: + /* This should never happen. */ + abort (); + } + break; default: printf (_("<unknown: %x>"), bit); break; diff --git a/binutils/testsuite/binutils-all/i386/shstk.d b/binutils/testsuite/binutils-all/i386/shstk.d new file mode 100644 index 0000000..933704c --- /dev/null +++ b/binutils/testsuite/binutils-all/i386/shstk.d @@ -0,0 +1,9 @@ +#PROG: objcopy +#as: --32 +#objcopy: +#readelf: -n + +Displaying notes found in: .note.gnu.property + Owner Data size Description + GNU 0x0000000c NT_GNU_PROPERTY_TYPE_0 + Properties: x86 feature: SHSTK diff --git a/binutils/testsuite/binutils-all/i386/shstk.s b/binutils/testsuite/binutils-all/i386/shstk.s new file mode 100644 index 0000000..4c3218a --- /dev/null +++ b/binutils/testsuite/binutils-all/i386/shstk.s @@ -0,0 +1,27 @@ + .section ".note.gnu.property", "a" +.ifdef __64_bit__ + .p2align 3 +.else + .p2align 2 +.endif + .long 1f - 0f /* name length */ + .long 5f - 2f /* data length */ + .long 5 /* note type */ +0: .asciz "GNU" /* vendor name */ +1: +.ifdef __64_bit__ + .p2align 3 +.else + .p2align 2 +.endif +2: .long 0xc0000002 /* pr_type. */ + .long 4f - 3f /* pr_datasz. */ +3: + .long 0x2 +4: +.ifdef __64_bit__ + .p2align 3 +.else + .p2align 2 +.endif +5: diff --git a/binutils/testsuite/binutils-all/x86-64/shstk-x32.d b/binutils/testsuite/binutils-all/x86-64/shstk-x32.d new file mode 100644 index 0000000..1dfc4fd --- /dev/null +++ b/binutils/testsuite/binutils-all/x86-64/shstk-x32.d @@ -0,0 +1,10 @@ +#source: shstk.s +#PROG: objcopy +#as: --x32 +#objcopy: +#readelf: -n + +Displaying notes found in: .note.gnu.property + Owner Data size Description + GNU 0x0000000c NT_GNU_PROPERTY_TYPE_0 + Properties: x86 feature: SHSTK diff --git a/binutils/testsuite/binutils-all/x86-64/shstk.d b/binutils/testsuite/binutils-all/x86-64/shstk.d new file mode 100644 index 0000000..1f131b8 --- /dev/null +++ b/binutils/testsuite/binutils-all/x86-64/shstk.d @@ -0,0 +1,9 @@ +#PROG: objcopy +#as: --64 -defsym __64_bit__=1 +#objcopy: +#readelf: -n + +Displaying notes found in: .note.gnu.property + Owner Data size Description + GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0 + Properties: x86 feature: SHSTK diff --git a/binutils/testsuite/binutils-all/x86-64/shstk.s b/binutils/testsuite/binutils-all/x86-64/shstk.s new file mode 100644 index 0000000..4c3218a --- /dev/null +++ b/binutils/testsuite/binutils-all/x86-64/shstk.s @@ -0,0 +1,27 @@ + .section ".note.gnu.property", "a" +.ifdef __64_bit__ + .p2align 3 +.else + .p2align 2 +.endif + .long 1f - 0f /* name length */ + .long 5f - 2f /* data length */ + .long 5 /* note type */ +0: .asciz "GNU" /* vendor name */ +1: +.ifdef __64_bit__ + .p2align 3 +.else + .p2align 2 +.endif +2: .long 0xc0000002 /* pr_type. */ + .long 4f - 3f /* pr_datasz. */ +3: + .long 0x2 +4: +.ifdef __64_bit__ + .p2align 3 +.else + .p2align 2 +.endif +5: |