/* 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;
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;
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;
-*- 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.
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. */
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.
OPTION_CTF_VARIABLES,
OPTION_NO_CTF_VARIABLES,
OPTION_CTF_SHARE_TYPES,
+ OPTION_WARN_EXECSTACK,
+ OPTION_NO_WARN_EXECSTACK,
};
/* The initial parser states. */
{ {"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},
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;
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"));
#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-*-*
}
}
-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" \
{{readelf {-Wl} stack-noexec.rd}} \
"stack-noexec.exe"] \
[list "stack size" \
- "-z stack-size=0x123400" \
+ "-z stack-size=0x123400 -z noexecstack" \
"" \
"" \
{stack.s} \
{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] {
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" \
] \
[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" \
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" \
run_cc_link_tests [list \
[list \
"Build indirect-extern-access-1.so" \
- "-shared" \
+ "-shared -z noexecstack" \
"-fPIC" \
{ indirect-extern-access-1a.c } \
{} \
] \
[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 } \
] \
[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 } \
] \
[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 } \
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" \
] \
[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" \
] \
[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" \
] \
[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" \
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}} \
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" \
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]] \
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}} \
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" \
--- /dev/null
+ .text
+ .global main
+main:
+ .nop
+
+ .section .note.GNU-stack,"x",%progbits
--- /dev/null
+ .text
+ .globl foo
+foo:
+ .nop
+
--- /dev/null
+.*: warning: .*\.o: requires executable stack \(because the \.note\.GNU-stack section is executable\)
--- /dev/null
+.*: warning: .*\.o: missing \.note\.GNU-stack section implies executable stack
--- /dev/null
+.*: warning: enabling an executable stack because of -z execstack command line option
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"
.D4:
.picptr funcdesc(.Fb)
.word .Fb
+ .section .note.GNU-stack
GD4:
.picptr funcdesc(GFb)
.word GFb
+ .section .note.GNU-stack
HD4:
.picptr funcdesc(HFb)
.word HFb
+ .section .note.GNU-stack
PD4:
.picptr funcdesc(PFb)
.word PFb
+ .section .note.GNU-stack
.picptr funcdesc(UFb)
.word UFb
+ .section .note.GNU-stack
.picptr funcdesc(WFb)
.word WFb
+ .section .note.GNU-stack
.D4:
.picptr funcdesc(.Fb+4)
.word .Fb+4
+ .section .note.GNU-stack
GD4:
.picptr funcdesc(GFb+4)
.word GFb+4
+ .section .note.GNU-stack
.size x, 4
x:
.zero 4
+ .section .note.GNU-stack
sethi.p #gottlsoffhi(0), gr14
setlo #gottlsofflo(0), gr14
ld #tlsoff(0)@(gr15, gr14), gr9
+
+ .section .note.GNU-stack
setlo #gottlsofflo(i+1+4096), gr8
ld #tlsoff(i+1+4096)@(gr15, gr8), gr9
.endif
+
+ .section .note.GNU-stack
sethi.p #gottlsoffhi(u), gr14
setlo #gottlsofflo(u), gr14
ld #tlsoff(u)@(gr15, gr14), gr9
+
+ .section .note.GNU-stack
# Dummy
+ .section ".note.GNU-stack"
"--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"}
-#ld: -r tmpdir/lto-3b.o
+#ld: -r tmpdir/lto-3b.o -z noexecstack
#source: dummy.s
#nm: -p
-#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
"" "-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" \
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"] \
]
.type a, @object
.size a, 4
a:
+ .section .note.GNU-stack
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\.\.\.
.hidden c
.scomm c,4,4
+ .section .note.GNU-stack
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\.\.\.
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\.\.\.
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\.\.\.
ldw .d2t2 *+B14(c), B9
nop 1
.size sub, .-sub
+ .section .note.GNU-stack
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\.\.\.
w:
.long g1
.long g2
+ .section .note.GNU-stack
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\.\.\.
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\.\.\.
.size b, 4
b:
.long 0x12345678
+ .section .note.GNU-stack
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\.\.\.
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\.\.\.
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\.\.\.
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\.\.\.
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\.\.\.
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\.\.\.
.global main
main:
.long 0
+
+ .section .note.GNU-stack,""
+
.global main
main:
.dc.a b_val
+
+ .section .note.GNU-stack
.type b_val, %gnu_unique_object
b_val: .long 0
.size b_val, .-b_val
+ .section .note.GNU-stack
# Dummy
+ .section ".note.GNU-stack"
.globl foo
foo:
mov %eax, %ebx
+ .section .note.GNU-stack
addq $8, %rsp
jmp *myexit@GOTPCREL(%rip)
.size main, .-main
+ .section .note.GNU-stack
.size __FUNCTION__.2215, 4
__FUNCTION__.2215:
.string "bar"
+ .section .note.GNU-stack
.data
zed:
.long f - .
+ .section .note.GNU-stack
.align 8
.long 4660
.long 22136
+ .section .note.GNU-stack
.align 8
.long 4660
.long 22136
+ .section .note.GNU-stack
.globl foo
foo:
.byte 0
+
+ .section .note.GNU-stack
.data
.dc.a foo
+ .section .note.GNU-stack
.size foo, 4
foo:
.long -1
+ .section .note.GNU-stack
.size foo_p, 4
foo_p:
.long foo
+ .section .note.GNU-stack
movabsq $strings@SIZE, %rdx
.section .data.rel,"aw",@progbits
.quad strings
+ .section .note.GNU-stack
popq %r15
ret
.size main, .-main
+ .section .note.GNU-stack
main:
movl foo(%rip), %eax
.size main, .-main
+ .section .note.GNU-stack
.type foo, @function
foo:
ret
+ .section .note.GNU-stack
5:
.p2align ALIGN
3:
+ .section .note.GNU-stack
.long 0 /* pr_datasz. */
.p2align ALIGN
3:
+ .section .note.GNU-stack
5:
.p2align ALIGN
3:
+ .section .note.GNU-stack
5:
.p2align ALIGN
3:
+ .section .note.GNU-stack
5:
.p2align ALIGN
3:
+ .section .note.GNU-stack
5:
.p2align ALIGN
3:
+ .section .note.GNU-stack
5:
.p2align ALIGN
3:
+ .section .note.GNU-stack
.globl _start
_start:
jmp foo
+ .section .note.GNU-stack