From 8a6b075bc07f66678ed0176f895847df3ea7fcef Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 6 Nov 2018 09:38:33 -0800 Subject: elfedit: Add --enable-x86-feature/--disable-x86-feature Add --enable-x86-feature and --disable-x86-feature options to elfedit to set and clear the IBT and SHSTK bits in program property in ELF executables and shared objects. binutils/ * doc/binutils.texi: Document --enable-x86-feature and --disable-x86-feature options for elfedit. * elfedit.c: Include "config.h" and . (enable_x86_features): New. (disable_x86_features): Likewise. (update_gnu_property): Likewise. (elf_x86_feature): Likewise. (process_file): Call update_gnu_property on ET_EXEC or ET_DYN file. (command_line_switch): Add OPTION_ENABLE_X86_FEATURE and OPTION_DISABLE_X86_FEATURE. (options): Add--enable-x86-feature and --disable-x86-feature. (usage): Likewise. (main): Handle OPTION_ENABLE_X86_FEATURE and OPTION_DISABLE_X86_FEATURE. ld/ * testsuite/config/default.exp (ELFEDIT): New. * testsuite/ld-elf/linux-x86.exp (elfedit_test): New proc. Run elfedit tests. * testsuite/ld-elf/x86-feature-1a.rd: New file. * testsuite/ld-elf/x86-feature-1b.rd: Likewise. * testsuite/ld-elf/x86-feature-1c.rd: Likewise. * testsuite/ld-elf/x86-feature-1d.rd: Likewise. * testsuite/ld-elf/x86-feature-1e.rd: Likewise. --- ld/testsuite/config/default.exp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ld/testsuite/config') diff --git a/ld/testsuite/config/default.exp b/ld/testsuite/config/default.exp index 704ac30..fbc12ea 100644 --- a/ld/testsuite/config/default.exp +++ b/ld/testsuite/config/default.exp @@ -243,6 +243,10 @@ if ![info exists READELFFLAGS] then { set READELFFLAGS {} } +if ![info exists ELFEDIT] then { + set ELFEDIT [findfile $base_dir/../binutils/elfedit] +} + if ![info exists LD] then { set LD [findfile $base_dir/ld-new ./ld-new [transform ld]] } -- cgit v1.1