aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-aarch64/nto-stack-note.s
diff options
context:
space:
mode:
authorClément Chigot <chigot@adacore.com>2023-10-05 11:29:32 +0200
committerClément Chigot <chigot@adacore.com>2023-10-13 16:23:39 +0200
commit318d83e658773d09a0cd62f65aa3bb4bf4474a38 (patch)
tree0e53306098a162e0fed88f82e9bef0f1899f74ba /ld/testsuite/ld-aarch64/nto-stack-note.s
parent9326300e4d3dbe943380b30766ed474d98df07ba (diff)
downloadbinutils-318d83e658773d09a0cd62f65aa3bb4bf4474a38.zip
binutils-318d83e658773d09a0cd62f65aa3bb4bf4474a38.tar.gz
binutils-318d83e658773d09a0cd62f65aa3bb4bf4474a38.tar.bz2
ld: allow update of existing QNX stack note
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.
Diffstat (limited to 'ld/testsuite/ld-aarch64/nto-stack-note.s')
-rw-r--r--ld/testsuite/ld-aarch64/nto-stack-note.s14
1 files changed, 14 insertions, 0 deletions
diff --git a/ld/testsuite/ld-aarch64/nto-stack-note.s b/ld/testsuite/ld-aarch64/nto-stack-note.s
new file mode 100644
index 0000000..9e48ab8
--- /dev/null
+++ b/ld/testsuite/ld-aarch64/nto-stack-note.s
@@ -0,0 +1,14 @@
+ .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: