mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-06 12:09:26 +08:00
318d83e658
Up to now, the linker would always create a QNX stack note from scratch. However, object files could already have such note, ending up into duplicates. QNX loader doesn't handle that. Update the mechanism to first search through the input files for a .note section holding a QNX stack note. If none are found, then a new section is created into the stub file as before. This requires this search to be done once the file have been opened, moving the whole logic a bit later in the emulation process. As part for this update, also allow to request an executable stack without necessarily having to provide its size as well. In this case, s etup a default lazy stack of 0x1000. ld/ChangeLog: * emultempl/nto.em (nto_create_QNX_note_section): New Function. (nto_lookup_QNX_note_section): New Function. (nto_add_note_section): Move the creation of the note section in the above new functions. (nto_create_output_section_statements): rename nto_after_open * testsuite/ld-aarch64/aarch64-nto.exp: add new test. * testsuite/ld-aarch64/nto-stack-note-3.d: New test. * testsuite/ld-aarch64/nto-stack-note.s: New test.
15 lines
305 B
ArmAsm
15 lines
305 B
ArmAsm
.global _start
|
|
.text
|
|
_start:
|
|
nop
|
|
|
|
.section .note
|
|
.long 1f - 0f /* name length */
|
|
.long 2f - 1f /* data length */
|
|
.long 3 /* note type */
|
|
0: .asciz "QNX" /* vendore name */
|
|
1: .long 0x4321
|
|
.long 0x1234
|
|
.long 0x0
|
|
2:
|