aboutsummaryrefslogtreecommitdiff
path: root/test/elf/X86_64/note-sections-ro_plus_rw.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/elf/X86_64/note-sections-ro_plus_rw.test')
-rw-r--r--test/elf/X86_64/note-sections-ro_plus_rw.test42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/elf/X86_64/note-sections-ro_plus_rw.test b/test/elf/X86_64/note-sections-ro_plus_rw.test
new file mode 100644
index 000000000000..ddeeaa41a758
--- /dev/null
+++ b/test/elf/X86_64/note-sections-ro_plus_rw.test
@@ -0,0 +1,42 @@
+# This tests the functionality that lld is able to recreate the note sections
+# if they appear in the input, it looks like we need to differentiate RO note
+# sections from RW note sections, and each creating a segment of its own
+
+RUN: lld -flavor gnu -target x86_64-linux %p/Inputs/note_ro_rw.o \
+RUN: --noinhibit-exec -o %t -static
+RUN: llvm-readobj -sections %t | FileCheck -check-prefix=NOTESECTIONS %s
+RUN: llvm-readobj -program-headers %t | FileCheck -check-prefix=NOTESEGMENT %s
+
+NOTESECTIONS: Section {
+NOTESECTIONS: Name: .note.ro (1)
+NOTESECTIONS: Type: SHT_NOTE (0x7)
+NOTESECTIONS: Flags [ (0x2)
+NOTESECTIONS: SHF_ALLOC (0x2)
+NOTESECTIONS: ]
+NOTESECTIONS: AddressAlignment: 4
+NOTESECTIONS: }
+NOTESECTIONS: Section {
+NOTESECTIONS: Name: .note.rw (31)
+NOTESECTIONS: Type: SHT_NOTE (0x7)
+NOTESECTIONS: Flags [ (0x3)
+NOTESECTIONS: SHF_ALLOC (0x2)
+NOTESECTIONS: SHF_WRITE (0x1)
+NOTESECTIONS: ]
+NOTESECTIONS: Size: 28
+NOTESECTIONS: AddressAlignment: 4
+NOTESECTIONS: }
+NOTESEGMENT: ProgramHeader {
+NOTESEGMENT: Type: PT_NOTE (0x4)
+NOTESEGMENT: Flags [ (0x4)
+NOTESEGMENT: PF_R (0x4)
+NOTESEGMENT: ]
+NOTESEGMENT: Alignment: 4
+NOTESEGMENT: }
+NOTESEGMENT: ProgramHeader {
+NOTESEGMENT: Type: PT_NOTE (0x4)
+NOTESEGMENT: Flags [ (0x6)
+NOTESEGMENT: PF_R (0x4)
+NOTESEGMENT: PF_W (0x2)
+NOTESEGMENT: ]
+NOTESEGMENT: Alignment: 4
+NOTESEGMENT: }