Skip to content

Commit

Permalink
[llvm-readobj] llvm-readobj --elf-output-style=GNU => llvm-readelf
Browse files Browse the repository at this point in the history
While updating the test, change -l -S to -S -l as the output of -S goes
before -l.

llvm-svn: 359653
  • Loading branch information
MaskRay committed May 1, 2019
1 parent 97c17e8 commit 4672e52
Show file tree
Hide file tree
Showing 20 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion lld/test/ELF/eh-frame-padding-no-rosegment.s
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ bar:
// RUN: ld.lld --hash-style=sysv %t.o -no-rosegment -o %t -shared

// Check that .eh_frame is in the same segment as .text
// RUN: llvm-readobj -l --elf-output-style=GNU %t | FileCheck --check-prefix=PHDR %s
// RUN: llvm-readelf -l %t | FileCheck --check-prefix=PHDR %s

// PHDR: Segment Sections
// PHDR: .eh_frame {{.*}}.text
Expand Down
2 changes: 1 addition & 1 deletion lld/test/ELF/empty-pt-load.s
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// REQUIRES: x86
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
// RUN: ld.lld %t.o -o %t.so -shared
// RUN: llvm-readobj -l --elf-output-style=GNU %t.so | FileCheck %s
// RUN: llvm-readelf -l %t.so | FileCheck %s

// Test that we don't create an empty executable PT_LOAD.

Expand Down
2 changes: 1 addition & 1 deletion lld/test/ELF/gc-sections-keep-shared-start.s
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
# RUN: ld.lld -shared --gc-sections -o %t1 %t
# RUN: llvm-readobj --elf-output-style=GNU --file-headers --symbols %t1
# RUN: llvm-readelf --file-headers --symbols %t1
# | FileCheck %s
# CHECK: Entry point address: 0x1000
# CHECK: 0000000000001000 0 FUNC LOCAL HIDDEN 4 _start
Expand Down
2 changes: 1 addition & 1 deletion lld/test/ELF/gc-sections-non-alloc-to-merge.s
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
# RUN: ld.lld %t.o -o %t --gc-sections
# RUN: llvm-readobj -S --elf-output-style=GNU %t | FileCheck %s
# RUN: llvm-readelf -S %t | FileCheck %s

# CHECK: .merge1 PROGBITS {{[0-9a-z]*}} {{[0-9a-z]*}} 000004

Expand Down
2 changes: 1 addition & 1 deletion lld/test/ELF/linkerscript/extend-pt-load1.test
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/extend-pt-load.s -o %t.o
# RUN: ld.lld --hash-style=sysv -o %t1 --script %s %t.o -shared
# RUN: llvm-readobj --elf-output-style=GNU -l -S %t1 | FileCheck %s
# RUN: llvm-readelf -S -l %t1 | FileCheck %s

# This test demonstrates an odd consequence of the way we handle sections with just symbol
# assignments.
Expand Down
2 changes: 1 addition & 1 deletion lld/test/ELF/linkerscript/extend-pt-load2.test
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/extend-pt-load.s -o %t.o
# RUN: ld.lld --hash-style=sysv -o %t2 --script %s %t.o -shared
# RUN: llvm-readobj --elf-output-style=GNU -l -S %t2 | FileCheck %s
# RUN: llvm-readelf -S -l %t2 | FileCheck %s

# Then add the section bar. Note how bar is given AX flags, which causes the PT_LOAD to now
# cover the padding bits created by ALIGN.
Expand Down
2 changes: 1 addition & 1 deletion lld/test/ELF/linkerscript/extend-pt-load3.test
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/extend-pt-load.s -o %t.o
# RUN: ld.lld --hash-style=sysv -o %t3 --script %s %t.o -shared
# RUN: llvm-readobj --elf-output-style=GNU -l -S %t3 | FileCheck --check-prefix=CHECK %s
# RUN: llvm-readelf -S -l %t3 | FileCheck --check-prefix=CHECK %s

# If the current behavior becomes a problem we should consider just moving the commands out
# of the section. That is, handle the above like the following test.
Expand Down
2 changes: 1 addition & 1 deletion lld/test/ELF/linkerscript/header-phdr.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# RUN: echo '.section .zed, "a"; .zero 4' \
# RUN: | llvm-mc -filetype=obj -triple=x86_64-unknown-linux - -o %t.o
# RUN: ld.lld --script %s %t.o -o %t
# RUN: llvm-readelf -l -S -W %t | FileCheck %s
# RUN: llvm-readelf -S -l -W %t | FileCheck %s

# CHECK: [ 1] .abc PROGBITS 0000000000001000 001000 000004 00 A 0 0 1
# CHECK: LOAD 0x000000 0x0000000000000000 0x0000000000000000 0x001004 0x001004 R E 0x1000
Expand Down
2 changes: 1 addition & 1 deletion lld/test/ELF/linkerscript/multiple-tbss.s
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
# RUN: echo "SECTIONS { }" > %t.script
# RUN: ld.lld -T %t.script %t.o -o %t
# RUN: llvm-readobj -l -S %t | FileCheck %s
# RUN: llvm-readobj -S -l %t | FileCheck %s

# CHECK: Name: .tbss
# CHECK-NEXT: Type: SHT_NOBITS
Expand Down
6 changes: 3 additions & 3 deletions lld/test/ELF/linkerscript/overlapping-sections.s
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

# Verify that the .sec2 was indeed placed in a PT_LOAD where the PhysAddr
# overlaps with where .sec1 is loaded:
# RUN: llvm-readobj --sections -l --elf-output-style=GNU %t.so | FileCheck %s -check-prefix BAD-LMA
# RUN: llvm-readelf --sections -l %t.so | FileCheck %s -check-prefix BAD-LMA
# BAD-LMA-LABEL: Section Headers:
# BAD-LMA: .sec1 PROGBITS 0000000000008000 002000 000100 00 WA 0 0 1
# BAD-LMA: .sec2 PROGBITS 0000000000008800 002800 000100 00 WA 0 0 1
Expand All @@ -43,7 +43,7 @@

# Check that the expected binary was created with --noinhibit-exec:
# RUN: ld.lld -o %t.so --script %t-vaddr.script %t.o -shared --noinhibit-exec
# RUN: llvm-readobj --sections -l --elf-output-style=GNU %t.so | FileCheck %s -check-prefix BAD-VADDR
# RUN: llvm-readelf --sections -l %t.so | FileCheck %s -check-prefix BAD-VADDR
# BAD-VADDR-LABEL: Section Headers:
# BAD-VADDR: .sec1 PROGBITS 0000000000008000 002000 000100 00 WA 0 0 1
# BAD-VADDR: .sec2 PROGBITS 0000000000008020 003020 000100 00 WA 0 0 1
Expand Down Expand Up @@ -91,7 +91,7 @@
# Starting here the contents of .sec2 overwrites .sec1:
# BROKEN-OUTPUT-FILE-NEXT: 8040 02020202 02020202 02020202 02020202

# RUN: llvm-readobj --sections -l --elf-output-style=GNU %t.so | FileCheck %s -check-prefix BAD-BOTH
# RUN: llvm-readelf --sections -l %t.so | FileCheck %s -check-prefix BAD-BOTH
# BAD-BOTH-LABEL: Section Headers:
# BAD-BOTH: .sec1 PROGBITS 0000000000008000 002000 000100 00 WA 0 0 1
# BAD-BOTH: .sec2 PROGBITS 0000000000008040 002040 000100 00 WA 0 0 1
Expand Down
2 changes: 1 addition & 1 deletion lld/test/ELF/linkerscript/overlay.test
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ SECTIONS {
## .text does not cause overlapping error and that
## .text's VA is 0x1000 + max(sizeof(.out.big), sizeof(.out.small)).

# RUN: llvm-readobj --sections -l --elf-output-style=GNU %t | FileCheck %s
# RUN: llvm-readelf --sections -l %t | FileCheck %s

# CHECK: Section Headers:
# CHECK: Name Type Address Off Size
Expand Down
2 changes: 1 addition & 1 deletion lld/test/ELF/linkerscript/symbol-only-align.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# RUN: echo '.text; ret; .data; .quad 0' > %t.s
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %t.s -o %t.o
# RUN: ld.lld -o %t --script %s %t.o -shared
# RUN: llvm-readobj --elf-output-style=GNU -S --symbols -l %t | FileCheck %s
# RUN: llvm-readelf -S --symbols -l %t | FileCheck %s

PHDRS {
text PT_LOAD FLAGS(0x5);
Expand Down
2 changes: 1 addition & 1 deletion lld/test/ELF/linkerscript/ttext-script.s
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
# RUN: echo "SECTIONS { .text 0x200000 : { *(.text) } }" > %t.script
# RUN: ld.lld -T %t.script -Ttext 0x100000 %t.o -o %t
# RUN: llvm-readobj --elf-output-style=GNU -S %t | FileCheck %s
# RUN: llvm-readelf -S %t | FileCheck %s

# CHECK: .text PROGBITS 0000000000100000

Expand Down
2 changes: 1 addition & 1 deletion lld/test/ELF/local-symbols-order.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1.o

# RUN: ld.lld -o %t %t1.o %t2.o --emit-relocs
# RUN: llvm-readobj --symbols --sections --elf-output-style=GNU %t | FileCheck %s
# RUN: llvm-readelf --symbols --sections %t | FileCheck %s

## Check we sort local symbols to match the following order:
## file1, local1, section1, hidden1, file2, local2, section2, hidden2 ...
Expand Down
2 changes: 1 addition & 1 deletion lld/test/ELF/pr36475.s
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# RUN: echo " .got.plt : { BYTE(42); *(.got); } : ph_data" >> %t.script
# RUN: echo "}" >> %t.script
# RUN: ld.lld -T %t.script %t.o -o %t.elf
# RUN: llvm-readobj -l --elf-output-style=GNU %t.elf | FileCheck %s
# RUN: llvm-readelf -l %t.elf | FileCheck %s

# CHECK: Section to Segment mapping:
# CHECK-NEXT: Segment Sections...
Expand Down
2 changes: 1 addition & 1 deletion lld/test/ELF/relocation-copy-relro.s
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/relocation-copy-relro.s -o %t2.o
// RUN: ld.lld -shared %t2.o -o %t.so
// RUN: ld.lld --hash-style=sysv %t.o %t.so -o %t3
// RUN: llvm-readobj -l -S -r %t3 | FileCheck %s
// RUN: llvm-readobj -S -l -r %t3 | FileCheck %s

// CHECK: Name: .bss.rel.ro (48)
// CHECK-NEXT: Type: SHT_NOBITS (0x8)
Expand Down
6 changes: 3 additions & 3 deletions lld/test/ELF/relro.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
// RUN: ld.lld -shared %t2.o -o %t2.so

// RUN: ld.lld %t.o %t2.so -z now -z norelro -z relro -o %t
// RUN: llvm-readobj -l --elf-output-style=GNU %t | FileCheck --check-prefix=CHECK --check-prefix=FULLRELRO %s
// RUN: llvm-readelf -l %t | FileCheck --check-prefix=CHECK --check-prefix=FULLRELRO %s

// RUN: ld.lld %t.o %t2.so -z norelro -z relro -o %t
// RUN: llvm-readobj -l --elf-output-style=GNU %t | FileCheck --check-prefix=CHECK --check-prefix=PARTRELRO %s
// RUN: llvm-readelf -l %t | FileCheck --check-prefix=CHECK --check-prefix=PARTRELRO %s

// RUN: ld.lld %t.o %t2.so -z norelro -o %t
// RUN: llvm-readobj -l --elf-output-style=GNU %t | FileCheck --check-prefix=NORELRO %s
// RUN: llvm-readelf -l %t | FileCheck --check-prefix=NORELRO %s

// CHECK: Program Headers:
// CHECK-NEXT: Type
Expand Down
8 changes: 4 additions & 4 deletions lld/test/ELF/ttext-tdata-tbss.s
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

## Show what regular output gives to us.
# RUN: ld.lld %t.o -o %t1
# RUN: llvm-readobj --elf-output-style=GNU -l -S %t1 | FileCheck %s
# RUN: llvm-readelf -S -l %t1 | FileCheck %s
# CHECK: .rodata PROGBITS 0000000000200158 000158 000008
# CHECK-NEXT: .text PROGBITS 0000000000201000 001000 000001
# CHECK-NEXT: .aw PROGBITS 0000000000202000 002000 000008
Expand All @@ -15,7 +15,7 @@

## With .text at 0 there is no space to allocate the headers.
# RUN: ld.lld -Ttext 0x0 -Tdata 0x4000 -Tbss 0x8000 %t.o -o %t2
# RUN: llvm-readobj --elf-output-style=GNU -l -S %t2 | FileCheck %s --check-prefix=USER1
# RUN: llvm-readelf -S -l %t2 | FileCheck %s --check-prefix=USER1
# USER1: .text PROGBITS 0000000000000000 001000 000001
# USER1-NEXT: .data PROGBITS 0000000000004000 002000 000008
# USER1-NEXT: .bss NOBITS 0000000000008000 002008 000008
Expand All @@ -26,7 +26,7 @@

## With .text at 0x1000 there is space to allocate the headers.
# RUN: ld.lld -Ttext 0x1000 -Tdata 0x4000 -Tbss 0x8000 %t.o -o %t3
# RUN: llvm-readobj --elf-output-style=GNU -l -S %t3 | FileCheck %s --check-prefix=USER2
# RUN: llvm-readelf -S -l %t3 | FileCheck %s --check-prefix=USER2
# USER2: .text PROGBITS 0000000000001000 001000 000001
# USER2-NEXT: .data PROGBITS 0000000000004000 002000 000008
# USER2-NEXT: .bss NOBITS 0000000000008000 002008 000008
Expand All @@ -38,7 +38,7 @@

## With .text well above 200000 we don't need to change the image base
# RUN: ld.lld -Ttext 0x201000 %t.o -o %t4
# RUN: llvm-readobj --elf-output-style=GNU -l -S %t4 | FileCheck %s --check-prefix=USER3
# RUN: llvm-readelf -S -l %t4 | FileCheck %s --check-prefix=USER3
# USER3: .text PROGBITS 0000000000201000 001000 000001
# USER3-NEX: .rodata PROGBITS 0000000000202000 002000 000008
# USER3-NEX: .aw PROGBITS 0000000000203000 003000 000008
Expand Down
2 changes: 1 addition & 1 deletion lld/test/ELF/version-script-twice.s
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# RUN: echo "FBSD_1.1 {}; FBSD_1.2 {};" > %t.ver
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
# RUN: ld.lld -shared %t.o -o %t.so --version-script=%t.ver
# RUN: llvm-readobj --dyn-symbols --elf-output-style=GNU %t.so | FileCheck %s
# RUN: llvm-readelf --dyn-symbols %t.so | FileCheck %s

.weak openat
openat:
Expand Down
2 changes: 1 addition & 1 deletion lld/test/ELF/wrap-dynamic-undef.s
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/wrap-dynamic-undef.s -o %t2.o
# RUN: ld.lld %t2.o -o %t2.so -shared
# RUN: ld.lld %t1.o %t2.so -o %t --wrap foo
# RUN: llvm-readobj --dyn-syms --elf-output-style=GNU %t | FileCheck %s
# RUN: llvm-readelf --dyn-syms %t | FileCheck %s

# Test that the dynamic relocation uses foo. We used to produce a
# relocation with __real_foo.
Expand Down

0 comments on commit 4672e52

Please sign in to comment.