• Home
  • Raw
  • Download

Lines Matching full:section

1 ## Show that if --only-section is given, llvm-objcopy removes all sections
10 ## Specify one section. The output file should contain only that section.
11 # RUN: llvm-objcopy --only-section __TEXT,__text %t %t3
12 # RUN: llvm-readobj --sections --section-data --macho-segment %t3 \
13 # RUN: | FileCheck %s --check-prefix=ONLY-TEXT-SECTION
15 # ONLY-TEXT-SECTION: Sections [
16 # ONLY-TEXT-SECTION-NEXT: Section {
17 # ONLY-TEXT-SECTION-NEXT: Index: 0
18 # ONLY-TEXT-SECTION-NEXT: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
19 # ONLY-TEXT-SECTION-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
20 # ONLY-TEXT-SECTION-NEXT: Address: 0x0
21 # ONLY-TEXT-SECTION-NEXT: Size: 0x4
22 # ONLY-TEXT-SECTION-NEXT: Offset: 184
23 # ONLY-TEXT-SECTION-NEXT: Alignment: 0
24 # ONLY-TEXT-SECTION-NEXT: RelocationOffset: 0x0
25 # ONLY-TEXT-SECTION-NEXT: RelocationCount: 0
26 # ONLY-TEXT-SECTION-NEXT: Type: Regular (0x0)
27 # ONLY-TEXT-SECTION-NEXT: Attributes [ (0x800004)
28 # ONLY-TEXT-SECTION-NEXT: PureInstructions (0x800000)
29 # ONLY-TEXT-SECTION-NEXT: SomeInstructions (0x4)
30 # ONLY-TEXT-SECTION-NEXT: ]
31 # ONLY-TEXT-SECTION-NEXT: Reserved1: 0x0
32 # ONLY-TEXT-SECTION-NEXT: Reserved2: 0x0
33 # ONLY-TEXT-SECTION-NEXT: Reserved3: 0x0
34 # ONLY-TEXT-SECTION-NEXT: SectionData (
35 # ONLY-TEXT-SECTION-NEXT: 0000: AABBCCDD |....|
36 # ONLY-TEXT-SECTION-NEXT: )
37 # ONLY-TEXT-SECTION-NEXT: }
38 # ONLY-TEXT-SECTION-NEXT: ]
39 # ONLY-TEXT-SECTION-NEXT: Segment {
40 # ONLY-TEXT-SECTION-NEXT: Cmd: LC_SEGMENT_64
41 # ONLY-TEXT-SECTION-NEXT: Name:
42 # ONLY-TEXT-SECTION-NEXT: Size: 152
43 # ONLY-TEXT-SECTION-NEXT: vmaddr: 0x0
44 # ONLY-TEXT-SECTION-NEXT: vmsize: 0x4
45 # ONLY-TEXT-SECTION-NEXT: fileoff: 184
46 # ONLY-TEXT-SECTION-NEXT: filesize: 4
47 # ONLY-TEXT-SECTION-NEXT: maxprot: rwx
48 # ONLY-TEXT-SECTION-NEXT: initprot: rwx
49 # ONLY-TEXT-SECTION-NEXT: nsects: 1
50 # ONLY-TEXT-SECTION-NEXT: flags: 0x0
51 # ONLY-TEXT-SECTION-NEXT: }
53 ## Remove all sections if the specified section name is not present in the input.
54 # RUN: llvm-objcopy --only-section __TEXT,__nonexistent %t %t4 2>&1
55 # RUN: llvm-readobj --sections --section-data --macho-segment %t4 \
56 # RUN: | FileCheck %s --check-prefix=NONEXISTENT-SECTION
58 # NONEXISTENT-SECTION: Sections [
59 # NONEXISTENT-SECTION-NEXT: ]
60 # NONEXISTENT-SECTION-NEXT: Segment {
61 # NONEXISTENT-SECTION-NEXT: Cmd: LC_SEGMENT_64
62 # NONEXISTENT-SECTION-NEXT: Name:
63 # NONEXISTENT-SECTION-NEXT: Size: 72
64 # NONEXISTENT-SECTION-NEXT: vmaddr: 0x0
65 # NONEXISTENT-SECTION-NEXT: vmsize: 0x0
66 # NONEXISTENT-SECTION-NEXT: fileoff: 104
67 # NONEXISTENT-SECTION-NEXT: filesize: 0
68 # NONEXISTENT-SECTION-NEXT: maxprot: rwx
69 # NONEXISTENT-SECTION-NEXT: initprot: rwx
70 # NONEXISTENT-SECTION-NEXT: nsects: 0
71 # NONEXISTENT-SECTION-NEXT: flags: 0x0
72 # NONEXISTENT-SECTION-NEXT: }
75 # RUN: llvm-objcopy --only-section "__TEXT,*" %t %t5 2>&1
79 ## Make sure that it doesn't care about the segment/section name separator ",".
80 # RUN: llvm-objcopy --only-section "__TEXT*" %t %t6 2>&1