aboutsummaryrefslogtreecommitdiff
path: root/test/elf/X86_64/note-sections-ro_plus_rw.test
blob: ddeeaa41a7585a585d6f342fafa9c63bf73fc05f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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:  }