mirror of
https://github.com/bminor/binutils-gdb.git
synced 2026-02-05 20:21:29 +00:00
ELF: give .note.GNU-stack proper section type
Like all .note and .note.* sections it should be SHT_NOTE, not SHT_PROGBITS.
This commit is contained in:
2
gas/as.c
2
gas/as.c
@@ -1505,7 +1505,7 @@ main (int argc, char ** argv)
|
||||
gnustack = subseg_new (".note.GNU-stack", 0);
|
||||
bfd_set_section_flags (gnustack,
|
||||
SEC_READONLY | (flag_execstack ? SEC_CODE : 0));
|
||||
|
||||
elf_section_type (gnustack) = SHT_NOTE;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1327,8 +1327,10 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd,
|
||||
effect. Instead we create a .note.GNU-stack section in much the
|
||||
same way as the assembler does with its --[no]execstack option. */
|
||||
flagword flags = SEC_READONLY | (link_info.execstack ? SEC_CODE : 0);
|
||||
(void) bfd_make_section_with_flags (link_info.input_bfds,
|
||||
".note.GNU-stack", flags);
|
||||
s = bfd_make_section_with_flags (link_info.input_bfds,
|
||||
".note.GNU-stack", flags);
|
||||
if (s)
|
||||
elf_section_type (s) = SHT_NOTE;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user