From 93ab9c0de7ba4a477720622c7e772d76f646e3f5 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 11 Aug 2017 16:36:28 +0100 Subject: [PATCH] Add -z globalaudit linker command line option to set the DF_GLOBALAUDIT flag bit in the dynamic tags. * emultempl/elf32.em (handle_option): Accept the -z globalaudit command line option. * lexsup.c (elf_static_list_options): Add -z globalaudit. * ld.texinfo: Document the support for the new command line option. * NEWS: Mention the new feature. * testsuite/ld-elf/audit.exp: Add a test of the -z globalaudit command line option. * testsuite/ld-elf/globalaudit.rd: New file: Expected output from readelf. --- ld/ChangeLog | 13 +++++++++++++ ld/NEWS | 3 +++ ld/emultempl/elf32.em | 4 ++++ ld/ld.texinfo | 8 ++++++++ ld/lexsup.c | 2 ++ ld/testsuite/ld-elf/audit.exp | 3 +++ ld/testsuite/ld-elf/globalaudit.rd | 3 +++ 7 files changed, 36 insertions(+) create mode 100644 ld/testsuite/ld-elf/globalaudit.rd diff --git a/ld/ChangeLog b/ld/ChangeLog index 484c36c..fe06729 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,16 @@ +2017-08-11 Nick Clifton + + * emultempl/elf32.em (handle_option): Accept the -z globalaudit + command line option. + * lexsup.c (elf_static_list_options): Add -z globalaudit. + * ld.texinfo: Document the support for the new command line + option. + * NEWS: Mention the new feature. + * testsuite/ld-elf/audit.exp: Add a test of the -z globalaudit + command line option. + * testsuite/ld-elf/globalaudit.rd: New file: Expected output from + readelf. + 2017-08-11 H.J. Lu PR ld/21884 diff --git a/ld/NEWS b/ld/NEWS index 1393265..bb5a62b 100644 --- a/ld/NEWS +++ b/ld/NEWS @@ -1,4 +1,7 @@ -*- text -*- +* Add -z globalaudit command line option to force audit libraries to be run + for every dynamic object loaded by an executable - provided that the loader + supports this functionality. * Tighten linker script grammar around file name specifiers to prevent the use of SORT_BY_ALIGNMENT and SORT_BY_INIT_PRIORITY on filenames. These would diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em index 9ac1840..748f56b 100644 --- a/ld/emultempl/elf32.em +++ b/ld/emultempl/elf32.em @@ -2676,6 +2676,10 @@ fragment <