diff options
author | Alan Modra <amodra@gmail.com> | 2023-02-06 12:46:52 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2023-02-06 23:06:44 +1030 |
commit | 84789002905d6db444ee76431705c86cbcde5616 (patch) | |
tree | d5c9a4c3dcff7456e90d19643cdac3076567cdaf /include | |
parent | 9af467b82406614deb46151f838c336a7c8604db (diff) | |
download | fsf-binutils-gdb-84789002905d6db444ee76431705c86cbcde5616.zip fsf-binutils-gdb-84789002905d6db444ee76431705c86cbcde5616.tar.gz fsf-binutils-gdb-84789002905d6db444ee76431705c86cbcde5616.tar.bz2 |
ppc32 and "LOAD segment with RWX permissions"
When using a bss-plt we'll always trigger the RWX warning, which
disturbs gcc test results. On the other hand, there may be reason to
want the warning when gcc is configured with --enable-secureplt.
So turning off the warning entirely for powerpc might not be the best
solution. Instead, we'll turn off the warning whenever a bss-plt is
generated, unless the user explicitly asked for the warning.
bfd/
* elf32-ppc.c (ppc_elf_select_plt_layout): Set
no_warn_rwx_segments on generating a bss plt, unless explicity
enabled by the user. Also show the bss-plt warning when
--warn-rwx-segments is given without --bss-plt.
include/
* bfdlink.h (struct bfd_link_info): Add user_warn_rwx_segments.
ld/
* lexsup.c (parse_args): Set user_warn_rwx_segments.
* testsuite/ld-elf/elf.exp: Pass --secure-plt for powerpc to
the rwx tests.
Diffstat (limited to 'include')
-rw-r--r-- | include/bfdlink.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/bfdlink.h b/include/bfdlink.h index 26c459c..840790a 100644 --- a/include/bfdlink.h +++ b/include/bfdlink.h @@ -501,6 +501,9 @@ struct bfd_link_info /* TRUE if warnings should not be generated for TLS segments with eXecute permission or LOAD segments with RWX permissions. */ unsigned int no_warn_rwx_segments: 1; + /* TRUE if the user gave either --warn-rwx-segments or + --no-warn-rwx-segments. */ + unsigned int user_warn_rwx_segments: 1; /* TRUE if the stack can be made executable because of the absence of a .note.GNU-stack section in an input file. Note - even if this field |