Browse Source

Add linker warning for when it creates an executable stack.

PR 29072
binutils-2_39-branch
Nick Clifton 4 years ago
parent
commit
65daf5bed6
  1. 50
      bfd/elflink.c
  2. 4
      include/bfdlink.h
  3. 8
      ld/NEWS
  4. 1
      ld/emultempl/avrelf.em
  5. 27
      ld/ld.texi
  6. 2
      ld/ldlex.h
  7. 14
      ld/lexsup.c
  8. 2
      ld/testsuite/ld-elf/eh4.d
  9. 69
      ld/testsuite/ld-elf/elf.exp
  10. 28
      ld/testsuite/ld-elf/linux-x86.exp
  11. 6
      ld/testsuite/ld-elf/pr29072-a.s
  12. 5
      ld/testsuite/ld-elf/pr29072-b.s
  13. 1
      ld/testsuite/ld-elf/pr29072.a.warn
  14. 1
      ld/testsuite/ld-elf/pr29072.b.warn
  15. 1
      ld/testsuite/ld-elf/pr29072.c.warn
  16. 2
      ld/testsuite/ld-elf/shared.exp
  17. 1
      ld/testsuite/ld-frv/fdpic1.s
  18. 1
      ld/testsuite/ld-frv/fdpic2.s
  19. 1
      ld/testsuite/ld-frv/fdpic3.s
  20. 1
      ld/testsuite/ld-frv/fdpic4.s
  21. 1
      ld/testsuite/ld-frv/fdpic5.s
  22. 1
      ld/testsuite/ld-frv/fdpic6.s
  23. 1
      ld/testsuite/ld-frv/fdpic7.s
  24. 1
      ld/testsuite/ld-frv/fdpic8.s
  25. 1
      ld/testsuite/ld-frv/tls-1-dep.s
  26. 2
      ld/testsuite/ld-frv/tls-1.s
  27. 2
      ld/testsuite/ld-frv/tls-2.s
  28. 2
      ld/testsuite/ld-frv/tls-3.s
  29. 1
      ld/testsuite/ld-gc/dummy.s
  30. 4
      ld/testsuite/ld-i386/i386.exp
  31. 2
      ld/testsuite/ld-plugin/lto-3r.d
  32. 2
      ld/testsuite/ld-plugin/lto-5r.d
  33. 4
      ld/testsuite/ld-plugin/lto.exp
  34. 1
      ld/testsuite/ld-tic6x/got-reloc-global.s
  35. 2
      ld/testsuite/ld-tic6x/shlib-1.rd
  36. 1
      ld/testsuite/ld-tic6x/shlib-1.s
  37. 2
      ld/testsuite/ld-tic6x/shlib-1b.rd
  38. 2
      ld/testsuite/ld-tic6x/shlib-1r.rd
  39. 2
      ld/testsuite/ld-tic6x/shlib-1rb.rd
  40. 1
      ld/testsuite/ld-tic6x/shlib-2.s
  41. 2
      ld/testsuite/ld-tic6x/shlib-app-1.rd
  42. 1
      ld/testsuite/ld-tic6x/shlib-app-1.s
  43. 2
      ld/testsuite/ld-tic6x/shlib-app-1b.rd
  44. 2
      ld/testsuite/ld-tic6x/shlib-app-1r.rd
  45. 1
      ld/testsuite/ld-tic6x/shlib-app-1r.s
  46. 2
      ld/testsuite/ld-tic6x/shlib-app-1rb.rd
  47. 2
      ld/testsuite/ld-tic6x/shlib-noindex.rd
  48. 2
      ld/testsuite/ld-tic6x/static-app-1.rd
  49. 2
      ld/testsuite/ld-tic6x/static-app-1b.rd
  50. 2
      ld/testsuite/ld-tic6x/static-app-1r.rd
  51. 2
      ld/testsuite/ld-tic6x/static-app-1rb.rd
  52. 3
      ld/testsuite/ld-unique/unique.s
  53. 2
      ld/testsuite/ld-unique/unique_empty.s
  54. 1
      ld/testsuite/ld-unique/unique_shared.s
  55. 1
      ld/testsuite/ld-x86-64/dummy.s
  56. 1
      ld/testsuite/ld-x86-64/foo.s
  57. 1
      ld/testsuite/ld-x86-64/gotpcrel1a.S
  58. 1
      ld/testsuite/ld-x86-64/gotpcrel1d.S
  59. 1
      ld/testsuite/ld-x86-64/pr19031b.S
  60. 1
      ld/testsuite/ld-x86-64/pr19319a.S
  61. 1
      ld/testsuite/ld-x86-64/pr19319b.S
  62. 2
      ld/testsuite/ld-x86-64/pr19827a.S
  63. 1
      ld/testsuite/ld-x86-64/pr19827b.S
  64. 1
      ld/testsuite/ld-x86-64/pr19969a.S
  65. 1
      ld/testsuite/ld-x86-64/pr19969b.S
  66. 1
      ld/testsuite/ld-x86-64/pr20550a.s
  67. 1
      ld/testsuite/ld-x86-64/pr20800a.S
  68. 1
      ld/testsuite/ld-x86-64/pr22791-1b.s
  69. 1
      ld/testsuite/ld-x86-64/pr26711.s
  70. 1
      ld/testsuite/ld-x86-64/property-6c.S
  71. 1
      ld/testsuite/ld-x86-64/property-no-copy.S
  72. 1
      ld/testsuite/ld-x86-64/property-stack.S
  73. 1
      ld/testsuite/ld-x86-64/property-unsorted-1.S
  74. 1
      ld/testsuite/ld-x86-64/property-unsorted-2.S
  75. 1
      ld/testsuite/ld-x86-64/property-x86-1.S
  76. 1
      ld/testsuite/ld-x86-64/property-x86-2.S
  77. 1
      ld/testsuite/ld-x86-64/start.s

50
bfd/elflink.c

@ -7124,13 +7124,23 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd,
/* Determine any GNU_STACK segment requirements, after the backend
has had a chance to set a default segment size. */
if (info->execstack)
elf_stack_flags (output_bfd) = PF_R | PF_W | PF_X;
{
/* If the user has explicitly requested warnings, then generate one even
though the choice is the result of another command line option. */
if (info->warn_execstack == 1)
_bfd_error_handler
(_("\
warning: enabling an executable stack because of -z execstack command line option"));
elf_stack_flags (output_bfd) = PF_R | PF_W | PF_X;
}
else if (info->noexecstack)
elf_stack_flags (output_bfd) = PF_R | PF_W;
else
{
bfd *inputobj;
asection *notesec = NULL;
bfd *noteobj = NULL;
bfd *emptyobj = NULL;
int exec = 0;
for (inputobj = info->input_bfds;
@ -7149,15 +7159,45 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd,
s = bfd_get_section_by_name (inputobj, ".note.GNU-stack");
if (s)
{
if (s->flags & SEC_CODE)
exec = PF_X;
notesec = s;
if (s->flags & SEC_CODE)
{
noteobj = inputobj;
exec = PF_X;
/* There is no point in scanning the remaining bfds. */
break;
}
}
else if (bed->default_execstack)
exec = PF_X;
{
exec = PF_X;
emptyobj = inputobj;
}
}
if (notesec || info->stacksize > 0)
elf_stack_flags (output_bfd) = PF_R | PF_W | exec;
{
if (exec)
{
if (info->warn_execstack != 2)
{
/* PR 29072: Because an executable stack is a serious
security risk, make sure that the user knows that it is
being enabled despite the fact that it was not requested
on the command line. */
if (noteobj)
_bfd_error_handler (_("\
warning: %s: requires executable stack (because the .note.GNU-stack section is executable)"),
bfd_get_filename (noteobj));
else if (emptyobj)
_bfd_error_handler (_("\
warning: %s: missing .note.GNU-stack section implies executable stack"),
bfd_get_filename (emptyobj));
}
}
elf_stack_flags (output_bfd) = PF_R | PF_W | exec;
}
if (notesec && exec && bfd_link_relocatable (info)
&& notesec->output_section != bfd_abs_section_ptr)
notesec->output_section->flags |= SEC_CODE;

4
include/bfdlink.h

@ -489,6 +489,10 @@ struct bfd_link_info
flags. */
unsigned int noexecstack: 1;
/* Tri-state variable: 0 => not set by user; 1 => set, warnings
enabled; 2 => warnings disabled; 3 => unused. */
unsigned int warn_execstack: 2;
/* TRUE if we want to produced optimized output files. This might
need much more time and therefore must be explicitly selected. */
unsigned int optimize: 1;

8
ld/NEWS

@ -1,5 +1,13 @@
-*- text -*-
* The linker will now generate a warning message if the stack is made
executable. By default this warning is not issued if the user has
specifically requested an executable stack via the "-z execstack"
command line option, but the warning can be forced via the new
"--warn-execstack" option. Alternatively all warnings about creating
an executable stack can be suppressed via the "--no-warn-execstack"
option.
* TYPE=<type> is now supported in an output section description to set the
section type value.

1
ld/emultempl/avrelf.em

@ -134,6 +134,7 @@ avr_elf_create_output_section_statements (void)
einfo (_("%X%P: can not create stub BFD: %E\n"));
return;
}
stub_file->the_bfd->flags |= BFD_LINKER_CREATED;
/* Now we add the stub section. */

27
ld/ld.texi

@ -2653,6 +2653,33 @@ Warn if any global constructors are used. This is only useful for a few
object file formats. For formats like COFF or ELF, the linker can not
detect the use of global constructors.
@kindex --warn-execstack
@cindex warnings, on exectuable stack
@cindex executable stack, warnings on
@item --warn-execstack
@itemx --no-warn-execstack
On ELF platforms this option controls how the linker generates warning
messages when it creates an output file with an executable stack. By
default the linker will not warn if the @command{-z execstack} command
line option has been used, but this behaviour can be overridden by the
@option{--warn-execstack} option.
On the other hand the linker will normally warn if the stack is made
executable because one or more of the input files need an execuable
stack and neither of the @command{-z execstack} or @command{-z
noexecstack} comman line options have been specified. This warning
can be disabled via the @command{--no-warn-execstack} option.
Note: ELF format input files specify that they need an executable
stack by having a @var{.note.GNU-stack} section with the executable
bit set in its section flags. They can specify that they do not need
an executable stack by having that section, but without the executable
flag bit set. If an input file does not have a @var{.note.GNU-stack}
section present then the default behaviour is target specific. For
some targets, then absence of such a section implies that an
executable stack @emph{is} required. This is often a problem for hand
crafted assembler files.
@kindex --warn-multiple-gp
@item --warn-multiple-gp
Warn if multiple global pointer values are required in the output file.

2
ld/ldlex.h

@ -164,6 +164,8 @@ enum option_values
OPTION_CTF_VARIABLES,
OPTION_NO_CTF_VARIABLES,
OPTION_CTF_SHARE_TYPES,
OPTION_WARN_EXECSTACK,
OPTION_NO_WARN_EXECSTACK,
};
/* The initial parser states. */

14
ld/lexsup.c

@ -536,6 +536,10 @@ static const struct ld_option ld_options[] =
{ {"warn-constructors", no_argument, NULL, OPTION_WARN_CONSTRUCTORS},
'\0', NULL, N_("Warn if global constructors/destructors are seen"),
TWO_DASHES },
{ {"warn-execstack", no_argument, NULL, OPTION_WARN_EXECSTACK},
'\0', NULL, N_("Warn when creating an executable stack"), TWO_DASHES },
{ {"no-warn-execstack", no_argument, NULL, OPTION_NO_WARN_EXECSTACK},
'\0', NULL, N_("Do not warn when creating an executable stack"), TWO_DASHES },
{ {"warn-multiple-gp", no_argument, NULL, OPTION_WARN_MULTIPLE_GP},
'\0', NULL, N_("Warn if the multiple GP values are used"), TWO_DASHES },
{ {"warn-once", no_argument, NULL, OPTION_WARN_ONCE},
@ -915,6 +919,12 @@ parse_args (unsigned argc, char **argv)
case OPTION_NON_CONTIGUOUS_REGIONS_WARNINGS:
link_info.non_contiguous_regions_warnings = true;
break;
case OPTION_WARN_EXECSTACK:
link_info.warn_execstack = 1;
break;
case OPTION_NO_WARN_EXECSTACK:
link_info.warn_execstack = 2;
break;
case 'e':
lang_add_entry (optarg, true);
break;
@ -2150,6 +2160,10 @@ elf_static_list_options (FILE *file)
fprintf (file, _("\
-z noexecstack Mark executable as not requiring executable stack\n"));
fprintf (file, _("\
--warn-execstack Generate a warning if the stack is executable\n"));
fprintf (file, _("\
--no-warn-execstack Do not generate a warning if the stack is executable\n"));
fprintf (file, _("\
-z unique-symbol Avoid duplicated local symbol names\n"));
fprintf (file, _("\
-z nounique-symbol Keep duplicated local symbol names (default)\n"));

2
ld/testsuite/ld-elf/eh4.d

@ -1,7 +1,7 @@
#source: eh4.s
#source: eh4a.s
#as: --64
#ld: -melf_x86_64 -shared -Ttext 0x400 -z max-page-size=0x200000 -z noseparate-code
#ld: -melf_x86_64 -shared -Ttext 0x400 -z max-page-size=0x200000 -z noseparate-code -z noexecstack
#readelf: -wf
#target: x86_64-*-*

69
ld/testsuite/ld-elf/elf.exp

@ -180,9 +180,24 @@ if { [check_gc_sections_available] && ![istarget "v850-*-*"] } {
}
}
if { [istarget *-*-*linux*]
|| [istarget *-*-nacl*]
|| [istarget *-*-gnu*] } {
proc target_defaults_to_execstack {} {
if { [istarget "aarch64*-*-*"]
|| [istarget "arc*-*-*"]
|| [istarget "ia64*-*-*"]
|| [istarget "loongarch*-*-*"]
|| [istarget "nios2*-*-*"]
|| [istarget "powerpc64*-*-*"]
|| [istarget "riscv*-*-*"]
|| [istarget "tilegx*-*-*"]
|| [istarget "tilepro*-*-*"] } {
return 0
}
return 1
}
if { [istarget *-*-*linux*]
|| [istarget *-*-nacl*]
|| [istarget *-*-gnu*] } {
run_ld_link_tests [list \
[list "stack exec" \
"-z execstack" \
@ -199,7 +214,7 @@ if { [istarget *-*-*linux*]
{{readelf {-Wl} stack-noexec.rd}} \
"stack-noexec.exe"] \
[list "stack size" \
"-z stack-size=0x123400" \
"-z stack-size=0x123400 -z noexecstack" \
"" \
"" \
{stack.s} \
@ -212,7 +227,49 @@ if { [istarget *-*-*linux*]
{pr23900-1.s} \
[list [list "readelf" {-Wl} $pr23900_1_exp]] \
"pr23900-1.exe"] \
[list "PR ld/29072 (warn about an executable .note-GNU-stack)" \
"-e 0" \
"" \
"" \
{pr29072-a.s} \
{{ld pr29072.a.warn}} \
"pr29072-a.exe"] \
[list "PR 29072 (warn about -z execstack)" \
"-z execstack --warn-execstack" \
"" \
"" \
{stack.s} \
{{ld pr29072.c.warn}} \
"pr29072-c.exe"] \
[list "PR ld/29072 (suppress warnings about executable stack)" \
"-e 0 --no-warn-execstack" \
"" \
"" \
{pr29072-a.s} \
{} \
"pr29072-d.exe"] \
]
if { [target_defaults_to_execstack] } {
run_ld_link_tests [list \
[list "PR ld/29072 (warn about absent .note-GNU-stack)" \
"-e 0 -z stack-size=0x123400" \
"" \
"" \
{pr29072-b.s} \
{{ld pr29072.b.warn}} \
"pr29072-b.exe"] \
]
} else {
run_ld_link_tests [list \
[list "PR ld/29072 (ignore absent .note-GNU-stackk)" \
"-e 0 -z stack-size=0x123400" \
"" \
"" \
{pr29072-b.s} \
{} \
"pr29072-b.exe"] \
]
}
}
if [check_gc_sections_available] {
@ -365,7 +422,7 @@ if { [istarget *-*-linux*]
run_ld_link_exec_tests [list \
[list \
"Run mbind2a" \
"$NOPIE_LDFLAGS -Wl,-z,common-page-size=0x4000" \
"$NOPIE_LDFLAGS -Wl,-z,common-page-size=0x4000 -Wl,-z,noexecstack" \
"" \
{ mbind2a.s mbind2b.c } \
"mbind2a" \
@ -374,7 +431,7 @@ if { [istarget *-*-linux*]
] \
[list \
"Run mbind2b" \
"-static -Wl,-z,common-page-size=0x4000" \
"-static -Wl,-z,common-page-size=0x4000 -Wl,-z,noexecstack" \
"" \
{ mbind2a.s mbind2b.c } \
"mbind2b" \

28
ld/testsuite/ld-elf/linux-x86.exp

@ -51,7 +51,7 @@ run_ld_link_tests [list \
run_ld_link_exec_tests [list \
[list \
"Run PR ld/23428 test" \
"--no-dynamic-linker -z separate-code" \
"--no-dynamic-linker -z separate-code -z noexecstack" \
"" \
{ linux-x86.S pr23428.c dummy.s } \
"pr23428" \
@ -76,7 +76,7 @@ run_ld_link_tests [list \
run_cc_link_tests [list \
[list \
"Build indirect-extern-access-1.so" \
"-shared" \
"-shared -z noexecstack" \
"-fPIC" \
{ indirect-extern-access-1a.c } \
{} \
@ -84,7 +84,7 @@ run_cc_link_tests [list \
] \
[list \
"Build indirect-extern-access-1a without PIE" \
"$NOPIE_LDFLAGS -Wl,--no-as-needed \
"$NOPIE_LDFLAGS -Wl,--no-as-needed -z noexecstack \
tmpdir/indirect-extern-access-1.so" \
"$NOPIE_CFLAGS" \
{ indirect-extern-access.S indirect-extern-access-1b.c } \
@ -101,7 +101,7 @@ run_cc_link_tests [list \
] \
[list \
"Build indirect-extern-access-2a without PIE" \
"$NOPIE_LDFLAGS -Wl,--no-as-needed \
"$NOPIE_LDFLAGS -Wl,--no-as-needed -z noexecstack \
tmpdir/indirect-extern-access-2.so" \
"$NOPIE_CFLAGS" \
{ indirect-extern-access.S indirect-extern-access-1b.c } \
@ -110,7 +110,7 @@ run_cc_link_tests [list \
] \
[list \
"Build indirect-extern-access-2b with PIE" \
"-pie -Wl,--no-as-needed \
"-pie -Wl,--no-as-needed -z noexecstack \
tmpdir/indirect-extern-access-2.so" \
"-fpie" \
{ indirect-extern-access.S indirect-extern-access-2b.c } \
@ -139,7 +139,7 @@ run_cc_link_tests [list \
run_ld_link_exec_tests [list \
[list \
"Run indirect-extern-access-1a without PIE" \
"$NOPIE_LDFLAGS" \
"$NOPIE_LDFLAGS -z noexecstack" \
"" \
{ indirect-extern-access.S indirect-extern-access-1b.c } \
"indirect-extern-access-1a" \
@ -151,7 +151,7 @@ run_ld_link_exec_tests [list \
] \
[list \
"Run indirect-extern-access-1b with PIE" \
"-pie" \
"-pie -z noexecstack" \
"" \
{ indirect-extern-access.S indirect-extern-access-1b.c } \
"indirect-extern-access-1b" \
@ -163,7 +163,7 @@ run_ld_link_exec_tests [list \
] \
[list \
"Run indirect-extern-access-2a without PIE" \
"$NOPIE_LDFLAGS" \
"$NOPIE_LDFLAGS -z noexecstack" \
"" \
{ indirect-extern-access.S indirect-extern-access-2b.c } \
"indirect-extern-access-2a" \
@ -175,7 +175,7 @@ run_ld_link_exec_tests [list \
] \
[list \
"Run indirect-extern-access-2b with PIE" \
"-pie" \
"-pie -z noexecstack" \
"" \
{ indirect-extern-access.S indirect-extern-access-2b.c } \
"indirect-extern-access-2b" \
@ -292,7 +292,7 @@ proc check_pr25749a {testname srcfilea srcfileb cflags ldflags lderror} {
run_cc_link_tests [list \
[list \
"Build $testname ($ldflags $cflags)" \
"$ldflags tmpdir/pr25749-bin.o" \
"$ldflags tmpdir/pr25749-bin.o -z noexecstack" \
"$cflags -I../bfd" \
[list $srcfilea $srcfileb]\
{{readelf {-Wr} pr25749.rd}} \
@ -302,7 +302,7 @@ proc check_pr25749a {testname srcfilea srcfileb cflags ldflags lderror} {
run_ld_link_exec_tests [list \
[list \
"Run ${testname}a ($ldflags $cflags)" \
"$ldflags tmpdir/pr25749-bin.o" \
"$ldflags tmpdir/pr25749-bin.o -z noexecstack" \
"" \
[list $srcfilea $srcfileb]\
"${testname}a" \
@ -314,7 +314,7 @@ proc check_pr25749a {testname srcfilea srcfileb cflags ldflags lderror} {
run_cc_link_tests [list \
[list \
"Build $testname ($ldflags $cflags)" \
"$ldflags tmpdir/pr25749-bin.o" \
"$ldflags tmpdir/pr25749-bin.o -z noexecstack" \
"$cflags -I../bfd" \
[list $srcfilea $srcfileb]\
[list [list error_output $lderror]] \
@ -395,7 +395,7 @@ proc check_pr25749b {testname srcfilea srcfileb cflags ldflags dsoldflags args}
run_cc_link_tests [list \
[list \
"Build lib${testname}.so ($dsoldflags)" \
"-shared $dsoldflags tmpdir/pr25749-bin.o" \
"-shared $dsoldflags tmpdir/pr25749-bin.o -z noexecstack" \
"-fPIC -I../bfd" \
[list $srcfileb] \
{{readelf {-Wr} pr25749.rd}} \
@ -411,7 +411,7 @@ proc check_pr25749b {testname srcfilea srcfileb cflags ldflags dsoldflags args}
run_ld_link_exec_tests [list \
[list \
"Run ${testname}b ($ldflags $cflags)" \
"$ldflags -Wl,--no-as-needed tmpdir/lib${testname}.so" \
"$ldflags -Wl,--no-as-needed tmpdir/lib${testname}.so -z noexecstack" \
"" \
[list $srcfilea]\
"${testname}b" \

6
ld/testsuite/ld-elf/pr29072-a.s

@ -0,0 +1,6 @@
.text
.global main
main:
.nop
.section .note.GNU-stack,"x",%progbits

5
ld/testsuite/ld-elf/pr29072-b.s

@ -0,0 +1,5 @@
.text
.globl foo
foo:
.nop

1
ld/testsuite/ld-elf/pr29072.a.warn

@ -0,0 +1 @@
.*: warning: .*\.o: requires executable stack \(because the \.note\.GNU-stack section is executable\)

1
ld/testsuite/ld-elf/pr29072.b.warn

@ -0,0 +1 @@
.*: warning: .*\.o: missing \.note\.GNU-stack section implies executable stack

1
ld/testsuite/ld-elf/pr29072.c.warn

@ -0,0 +1 @@
.*: warning: enabling an executable stack because of -z execstack command line option

2
ld/testsuite/ld-elf/shared.exp

@ -914,7 +914,7 @@ run_cc_link_tests [list \
if { ![istarget alpha-*-*] } {
append build_tests {
{"Build pr19073a.o"
"-r -nostdlib" ""
"-r -nostdlib -z noexecstack" ""
{pr19073.s} {} "pr19073a.o"}
{"Build libpr19073.so"
"-shared -Wl,--version-script=pr19073.map tmpdir/pr19073a.o" "-fPIC"

1
ld/testsuite/ld-frv/fdpic1.s

@ -62,3 +62,4 @@ D1:
.D4:
.picptr funcdesc(.Fb)
.word .Fb
.section .note.GNU-stack

1
ld/testsuite/ld-frv/fdpic2.s

@ -79,3 +79,4 @@ GD3:
GD4:
.picptr funcdesc(GFb)
.word GFb
.section .note.GNU-stack

1
ld/testsuite/ld-frv/fdpic3.s

@ -97,3 +97,4 @@ HD3:
HD4:
.picptr funcdesc(HFb)
.word HFb
.section .note.GNU-stack

1
ld/testsuite/ld-frv/fdpic4.s

@ -97,3 +97,4 @@ PD3:
PD4:
.picptr funcdesc(PFb)
.word PFb
.section .note.GNU-stack

1
ld/testsuite/ld-frv/fdpic5.s

@ -36,3 +36,4 @@ D5:
.picptr funcdesc(UFb)
.word UFb
.section .note.GNU-stack

1
ld/testsuite/ld-frv/fdpic6.s

@ -53,3 +53,4 @@ D6:
.picptr funcdesc(WFb)
.word WFb
.section .note.GNU-stack

1
ld/testsuite/ld-frv/fdpic7.s

@ -61,3 +61,4 @@ D7:
.D4:
.picptr funcdesc(.Fb+4)
.word .Fb+4
.section .note.GNU-stack

1
ld/testsuite/ld-frv/fdpic8.s

@ -79,3 +79,4 @@ GD3:
GD4:
.picptr funcdesc(GFb+4)
.word GFb+4
.section .note.GNU-stack

1
ld/testsuite/ld-frv/tls-1-dep.s

@ -5,3 +5,4 @@
.size x, 4
x:
.zero 4
.section .note.GNU-stack

2
ld/testsuite/ld-frv/tls-1.s

@ -83,3 +83,5 @@ _start:
sethi.p #gottlsoffhi(0), gr14
setlo #gottlsofflo(0), gr14
ld #tlsoff(0)@(gr15, gr14), gr9
.section .note.GNU-stack

2
ld/testsuite/ld-frv/tls-2.s

@ -181,3 +181,5 @@ _start:
setlo #gottlsofflo(i+1+4096), gr8
ld #tlsoff(i+1+4096)@(gr15, gr8), gr9
.endif
.section .note.GNU-stack

2
ld/testsuite/ld-frv/tls-3.s

@ -18,3 +18,5 @@ _start:
sethi.p #gottlsoffhi(u), gr14
setlo #gottlsofflo(u), gr14
ld #tlsoff(u)@(gr15, gr14), gr9
.section .note.GNU-stack

1
ld/testsuite/ld-gc/dummy.s

@ -1 +1,2 @@
# Dummy
.section ".note.GNU-stack"

4
ld/testsuite/ld-i386/i386.exp

@ -240,12 +240,12 @@ set i386tests {
"--32 -mx86-used-note=yes"
{ pr19827a.S } {{readelf {-rW} pr19827.rd}} "pr19827.so"}
{"Build pr27193a.so"
"-melf_i386 -shared" ""
"-melf_i386 -shared -z noexecstack" ""
"--32"
{ pr27193a.o.bz2 pr27193b.s }
{{objdump {-dw} pr27193.dd}} "pr27193a.so"}
{"Build pr27193b.so"
"-melf_i386 -shared --reduce-memory-overheads" ""
"-melf_i386 -shared --reduce-memory-overheads -z noexecstack" ""
"--32"
{ pr27193a.o.bz2 pr27193b.s }
{{objdump {-dw} pr27193.dd}} "pr27193b.so"}

2
ld/testsuite/ld-plugin/lto-3r.d

@ -1,4 +1,4 @@
#ld: -r tmpdir/lto-3b.o
#ld: -r tmpdir/lto-3b.o -z noexecstack
#source: dummy.s
#nm: -p

2
ld/testsuite/ld-plugin/lto-5r.d

@ -1,4 +1,4 @@
#ld: -r tmpdir/lto-5a.o tmpdir/lto-5b.o
#ld: -r tmpdir/lto-5a.o tmpdir/lto-5b.o -z noexecstack
#source: dummy.s
#nm: -p

4
ld/testsuite/ld-plugin/lto.exp

@ -127,7 +127,7 @@ set lto_link_tests [list \
"" "-flto -O2 $lto_fat $NOSANITIZE_CFLAGS" \
{pr12758b.c} {} "libpr12758.a"] \
[list "PR ld/12758" \
"$NOPIE_LDFLAGS $NOSANITIZE_CFLAGS -O2 -Wl,-e,foo -nostdlib -flto -fuse-linker-plugin tmpdir/pr12758a.o -Wl,--start-group tmpdir/libpr12758.a -Wl,--end-group" \
"$NOPIE_LDFLAGS $NOSANITIZE_CFLAGS -O2 -Wl,-e,foo -nostdlib -flto -fuse-linker-plugin tmpdir/pr12758a.o -Wl,--start-group tmpdir/libpr12758.a -Wl,--end-group -z noexecstack" \
"$NOSANITIZE_CFLAGS" \
{dummy.c} {} "pr12758.exe"] \
[list "Build libpr13183.a" \
@ -901,7 +901,7 @@ run_cc_link_tests $lto_link_symbol_tests
run_ld_link_tests [list \
[list "PR ld/19317 (2)" \
"-r tmpdir/pr19317.o" "" "" \
"-r tmpdir/pr19317.o -z noexecstack" "" "" \
{dummy.s} {} "pr19317-r.o"] \
]

1
ld/testsuite/ld-tic6x/got-reloc-global.s

@ -9,3 +9,4 @@
.type a, @object
.size a, 4
a:
.section .note.GNU-stack

2
ld/testsuite/ld-tic6x/shlib-1.rd

@ -31,7 +31,7 @@ Program Headers:
LOAD 0x001000 0x00008000 0x00008000 0x001fc 0x001fc RW 0x1000
LOAD 0x002000 0x10000000 0x10000000 0x00130 0x00134 RWE 0x1000
DYNAMIC 0x001154 0x00008154 0x00008154 0x000a8 0x000a8 RW 0x4
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x20000 RWE 0x8
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x20000 RW 0x8
Section to Segment mapping:
Segment Sections\.\.\.

1
ld/testsuite/ld-tic6x/shlib-1.s

@ -42,3 +42,4 @@ g2:
.hidden c
.scomm c,4,4
.section .note.GNU-stack

2
ld/testsuite/ld-tic6x/shlib-1b.rd

@ -31,7 +31,7 @@ Program Headers:
LOAD 0x001000 0x00008000 0x00008000 0x001fc 0x001fc RW 0x1000
LOAD 0x002000 0x10000000 0x10000000 0x00130 0x00134 RWE 0x1000
DYNAMIC 0x001154 0x00008154 0x00008154 0x000a8 0x000a8 RW 0x4
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x20000 RWE 0x8
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x20000 RW 0x8
Section to Segment mapping:
Segment Sections\.\.\.

2
ld/testsuite/ld-tic6x/shlib-1r.rd

@ -31,7 +31,7 @@ Program Headers:
LOAD 0x001000 0x00008000 0x00008000 0x001fc 0x001fc RW 0x1000
LOAD 0x002000 0x10000000 0x10000000 0x00130 0x00134 RWE 0x1000
DYNAMIC 0x001154 0x00008154 0x00008154 0x000a8 0x000a8 RW 0x4
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x20000 RWE 0x8
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x20000 RW 0x8
Section to Segment mapping:
Segment Sections\.\.\.

2
ld/testsuite/ld-tic6x/shlib-1rb.rd

@ -31,7 +31,7 @@ Program Headers:
LOAD 0x001000 0x00008000 0x00008000 0x001fc 0x001fc RW 0x1000
LOAD 0x002000 0x10000000 0x10000000 0x00130 0x00134 RWE 0x1000
DYNAMIC 0x001154 0x00008154 0x00008154 0x000a8 0x000a8 RW 0x4
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x20000 RWE 0x8
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x20000 RW 0x8
Section to Segment mapping:
Segment Sections\.\.\.

1
ld/testsuite/ld-tic6x/shlib-2.s

@ -21,3 +21,4 @@ sub:
ldw .d2t2 *+B14(c), B9
nop 1
.size sub, .-sub
.section .note.GNU-stack

2
ld/testsuite/ld-tic6x/shlib-app-1.rd

@ -32,7 +32,7 @@ Program Headers:
LOAD 0x001000 0x00008000 0x00008000 0x00208 0x00208 RW 0x1000
LOAD 0x002000 0x10000000 0x10000000 0x000cc 0x000d0 RWE 0x1000
DYNAMIC 0x001150 0x00008150 0x00008150 0x000b8 0x000b8 RW 0x4
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x20000 RWE 0x8
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x20000 RW 0x8
Section to Segment mapping:
Segment Sections\.\.\.

1
ld/testsuite/ld-tic6x/shlib-app-1.s

@ -29,3 +29,4 @@ b:
w:
.long g1
.long g2
.section .note.GNU-stack

2
ld/testsuite/ld-tic6x/shlib-app-1b.rd

@ -32,7 +32,7 @@ Program Headers:
LOAD 0x001000 0x00008000 0x00008000 0x00208 0x00208 RW 0x1000
LOAD 0x002000 0x10000000 0x10000000 0x000cc 0x000d0 RWE 0x1000
DYNAMIC 0x001150 0x00008150 0x00008150 0x000b8 0x000b8 RW 0x4
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x20000 RWE 0x8
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x20000 RW 0x8
Section to Segment mapping:
Segment Sections\.\.\.

2
ld/testsuite/ld-tic6x/shlib-app-1r.rd

@ -31,7 +31,7 @@ Program Headers:
LOAD 0x001000 0x00008000 0x00008000 0x001c4 0x001c4 RW 0x1000
LOAD 0x002000 0x10000000 0x10000000 0x000c4 0x000c8 RWE 0x1000
DYNAMIC 0x00110c 0x0000810c 0x0000810c 0x000b8 0x000b8 RW 0x4
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x20000 RWE 0x8
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x20000 RW 0x8
Section to Segment mapping:
Segment Sections\.\.\.

1
ld/testsuite/ld-tic6x/shlib-app-1r.s

@ -17,3 +17,4 @@ fish:
.size b, 4
b:
.long 0x12345678
.section .note.GNU-stack

2
ld/testsuite/ld-tic6x/shlib-app-1rb.rd

@ -31,7 +31,7 @@ Program Headers:
LOAD 0x001000 0x00008000 0x00008000 0x001c4 0x001c4 RW 0x1000
LOAD 0x002000 0x10000000 0x10000000 0x000c4 0x000c8 RWE 0x1000
DYNAMIC 0x00110c 0x0000810c 0x0000810c 0x000b8 0x000b8 RW 0x4
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x20000 RWE 0x8
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x20000 RW 0x8
Section to Segment mapping:
Segment Sections\.\.\.

2
ld/testsuite/ld-tic6x/shlib-noindex.rd

@ -32,7 +32,7 @@ Program Headers:
LOAD 0x001000 0x00008000 0x00008000 0x00210 0x00210 RW 0x1000
LOAD 0x002000 0x10000000 0x10000000 0x00130 0x00134 RWE 0x1000
DYNAMIC 0x001160 0x00008160 0x00008160 0x000b0 0x000b0 RW 0x4
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x20000 RWE 0x8
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x20000 RW 0x8
Section to Segment mapping:
Segment Sections\.\.\.

2
ld/testsuite/ld-tic6x/static-app-1.rd

@ -29,7 +29,7 @@ Program Headers:
LOAD 0x001000 0x00008000 0x00008000 0x001b8 0x001b8 RW 0x1000
LOAD 0x002000 0x10000000 0x10000000 0x000f4 0x000f8 RWE 0x1000
DYNAMIC 0x001128 0x00008128 0x00008128 0x00090 0x00090 RW 0x4
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x20000 RWE 0x8
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x20000 RW 0x8
Section to Segment mapping:
Segment Sections\.\.\.

2
ld/testsuite/ld-tic6x/static-app-1b.rd

@ -29,7 +29,7 @@ Program Headers:
LOAD 0x001000 0x00008000 0x00008000 0x001b8 0x001b8 RW 0x1000
LOAD 0x002000 0x10000000 0x10000000 0x000f4 0x000f8 RWE 0x1000
DYNAMIC 0x001128 0x00008128 0x00008128 0x00090 0x00090 RW 0x4
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x20000 RWE 0x8
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x20000 RW 0x8
Section to Segment mapping:
Segment Sections\.\.\.

2
ld/testsuite/ld-tic6x/static-app-1r.rd

@ -29,7 +29,7 @@ Program Headers:
LOAD 0x001000 0x00008000 0x00008000 0x001a0 0x001a0 RW 0x1000
LOAD 0x002000 0x10000000 0x10000000 0x000ec 0x000f0 RWE 0x1000
DYNAMIC 0x001110 0x00008110 0x00008110 0x00090 0x00090 RW 0x4
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x20000 RWE 0x8
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x20000 RW 0x8
Section to Segment mapping:
Segment Sections\.\.\.

2
ld/testsuite/ld-tic6x/static-app-1rb.rd

@ -29,7 +29,7 @@ Program Headers:
LOAD 0x001000 0x00008000 0x00008000 0x001a0 0x001a0 RW 0x1000
LOAD 0x002000 0x10000000 0x10000000 0x000ec 0x000f0 RWE 0x1000
DYNAMIC 0x001110 0x00008110 0x00008110 0x00090 0x00090 RW 0x4
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x20000 RWE 0x8
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x20000 RW 0x8
Section to Segment mapping:
Segment Sections\.\.\.

3
ld/testsuite/ld-unique/unique.s

@ -6,3 +6,6 @@ a_val: .long 0
.global main
main:
.long 0
.section .note.GNU-stack,""

2
ld/testsuite/ld-unique/unique_empty.s

@ -2,3 +2,5 @@
.global main
main:
.dc.a b_val
.section .note.GNU-stack

1
ld/testsuite/ld-unique/unique_shared.s

@ -1,3 +1,4 @@
.type b_val, %gnu_unique_object
b_val: .long 0
.size b_val, .-b_val
.section .note.GNU-stack

1
ld/testsuite/ld-x86-64/dummy.s

@ -1 +1,2 @@
# Dummy
.section ".note.GNU-stack"

1
ld/testsuite/ld-x86-64/foo.s

@ -1,3 +1,4 @@
.globl foo
foo:
mov %eax, %ebx
.section .note.GNU-stack

1
ld/testsuite/ld-x86-64/gotpcrel1a.S

@ -16,3 +16,4 @@ main:
addq $8, %rsp
jmp *myexit@GOTPCREL(%rip)
.size main, .-main
.section .note.GNU-stack

1
ld/testsuite/ld-x86-64/gotpcrel1d.S

@ -24,3 +24,4 @@ __FUNCTION__.2219:
.size __FUNCTION__.2215, 4
__FUNCTION__.2215:
.string "bar"
.section .note.GNU-stack

1
ld/testsuite/ld-x86-64/pr19031b.S

@ -16,3 +16,4 @@ h:
.data
zed:
.long f - .
.section .note.GNU-stack

1
ld/testsuite/ld-x86-64/pr19319a.S

@ -9,3 +9,4 @@ foo:
.align 8
.long 4660
.long 22136
.section .note.GNU-stack

1
ld/testsuite/ld-x86-64/pr19319b.S

@ -9,3 +9,4 @@ _start:
.align 8
.long 4660
.long 22136
.section .note.GNU-stack

2
ld/testsuite/ld-x86-64/pr19827a.S

@ -6,3 +6,5 @@ _start:
.globl foo
foo:
.byte 0
.section .note.GNU-stack

1
ld/testsuite/ld-x86-64/pr19827b.S

@ -1,2 +1,3 @@
.data
.dc.a foo
.section .note.GNU-stack

1
ld/testsuite/ld-x86-64/pr19969a.S

@ -5,3 +5,4 @@
.size foo, 4
foo:
.long -1
.section .note.GNU-stack

1
ld/testsuite/ld-x86-64/pr19969b.S

@ -12,3 +12,4 @@ _start:
.size foo_p, 4
foo_p:
.long foo
.section .note.GNU-stack

1
ld/testsuite/ld-x86-64/pr20550a.s

@ -4,3 +4,4 @@ _start:
movabsq $strings@SIZE, %rdx
.section .data.rel,"aw",@progbits
.quad strings
.section .note.GNU-stack

1
ld/testsuite/ld-x86-64/pr20800a.S

@ -15,3 +15,4 @@ main:
popq %r15
ret
.size main, .-main
.section .note.GNU-stack

1
ld/testsuite/ld-x86-64/pr22791-1b.s

@ -4,3 +4,4 @@
main:
movl foo(%rip), %eax
.size main, .-main
.section .note.GNU-stack

1
ld/testsuite/ld-x86-64/pr26711.s

@ -31,3 +31,4 @@
.type foo, @function
foo:
ret
.section .note.GNU-stack

1
ld/testsuite/ld-x86-64/property-6c.S

@ -21,3 +21,4 @@
5:
.p2align ALIGN
3:
.section .note.GNU-stack

1
ld/testsuite/ld-x86-64/property-no-copy.S

@ -18,3 +18,4 @@
.long 0 /* pr_datasz. */
.p2align ALIGN
3:
.section .note.GNU-stack

1
ld/testsuite/ld-x86-64/property-stack.S

@ -21,3 +21,4 @@
5:
.p2align ALIGN
3:
.section .note.GNU-stack

1
ld/testsuite/ld-x86-64/property-unsorted-1.S

@ -37,3 +37,4 @@
5:
.p2align ALIGN
3:
.section .note.GNU-stack

1
ld/testsuite/ld-x86-64/property-unsorted-2.S

@ -25,3 +25,4 @@
5:
.p2align ALIGN
3:
.section .note.GNU-stack

1
ld/testsuite/ld-x86-64/property-x86-1.S

@ -35,3 +35,4 @@
5:
.p2align ALIGN
3:
.section .note.GNU-stack

1
ld/testsuite/ld-x86-64/property-x86-2.S

@ -28,3 +28,4 @@
5:
.p2align ALIGN
3:
.section .note.GNU-stack

1
ld/testsuite/ld-x86-64/start.s

@ -1,3 +1,4 @@
.globl _start
_start:
jmp foo
.section .note.GNU-stack

Loading…
Cancel
Save