From 4672e52e22a02a336b1f5500d1e76c10ecfa4cee Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Wed, 1 May 2019 06:02:16 +0000 Subject: [PATCH] [llvm-readobj] llvm-readobj --elf-output-style=GNU => llvm-readelf While updating the test, change -l -S to -S -l as the output of -S goes before -l. llvm-svn: 359653 --- lld/test/ELF/eh-frame-padding-no-rosegment.s | 2 +- lld/test/ELF/empty-pt-load.s | 2 +- lld/test/ELF/gc-sections-keep-shared-start.s | 2 +- lld/test/ELF/gc-sections-non-alloc-to-merge.s | 2 +- lld/test/ELF/linkerscript/extend-pt-load1.test | 2 +- lld/test/ELF/linkerscript/extend-pt-load2.test | 2 +- lld/test/ELF/linkerscript/extend-pt-load3.test | 2 +- lld/test/ELF/linkerscript/header-phdr.test | 2 +- lld/test/ELF/linkerscript/multiple-tbss.s | 2 +- lld/test/ELF/linkerscript/overlapping-sections.s | 6 +++--- lld/test/ELF/linkerscript/overlay.test | 2 +- lld/test/ELF/linkerscript/symbol-only-align.test | 2 +- lld/test/ELF/linkerscript/ttext-script.s | 2 +- lld/test/ELF/local-symbols-order.s | 2 +- lld/test/ELF/pr36475.s | 2 +- lld/test/ELF/relocation-copy-relro.s | 2 +- lld/test/ELF/relro.s | 6 +++--- lld/test/ELF/ttext-tdata-tbss.s | 8 ++++---- lld/test/ELF/version-script-twice.s | 2 +- lld/test/ELF/wrap-dynamic-undef.s | 2 +- 20 files changed, 27 insertions(+), 27 deletions(-) diff --git a/lld/test/ELF/eh-frame-padding-no-rosegment.s b/lld/test/ELF/eh-frame-padding-no-rosegment.s index f075c46c8eb6..754903e40d92 100644 --- a/lld/test/ELF/eh-frame-padding-no-rosegment.s +++ b/lld/test/ELF/eh-frame-padding-no-rosegment.s @@ -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 diff --git a/lld/test/ELF/empty-pt-load.s b/lld/test/ELF/empty-pt-load.s index 4074b63cb80f..0f2cccc1339b 100644 --- a/lld/test/ELF/empty-pt-load.s +++ b/lld/test/ELF/empty-pt-load.s @@ -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. diff --git a/lld/test/ELF/gc-sections-keep-shared-start.s b/lld/test/ELF/gc-sections-keep-shared-start.s index 23417ca01dc6..7eb3c6ce3b85 100644 --- a/lld/test/ELF/gc-sections-keep-shared-start.s +++ b/lld/test/ELF/gc-sections-keep-shared-start.s @@ -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 diff --git a/lld/test/ELF/gc-sections-non-alloc-to-merge.s b/lld/test/ELF/gc-sections-non-alloc-to-merge.s index 69e9e1110d51..2b7b38498e0b 100644 --- a/lld/test/ELF/gc-sections-non-alloc-to-merge.s +++ b/lld/test/ELF/gc-sections-non-alloc-to-merge.s @@ -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 diff --git a/lld/test/ELF/linkerscript/extend-pt-load1.test b/lld/test/ELF/linkerscript/extend-pt-load1.test index 72ab5d7e9bac..c39e0244ec2c 100644 --- a/lld/test/ELF/linkerscript/extend-pt-load1.test +++ b/lld/test/ELF/linkerscript/extend-pt-load1.test @@ -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. diff --git a/lld/test/ELF/linkerscript/extend-pt-load2.test b/lld/test/ELF/linkerscript/extend-pt-load2.test index c70901a1f4ba..4fbeb505b178 100644 --- a/lld/test/ELF/linkerscript/extend-pt-load2.test +++ b/lld/test/ELF/linkerscript/extend-pt-load2.test @@ -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. diff --git a/lld/test/ELF/linkerscript/extend-pt-load3.test b/lld/test/ELF/linkerscript/extend-pt-load3.test index 25f748e2165c..9dd4ab8e0c43 100644 --- a/lld/test/ELF/linkerscript/extend-pt-load3.test +++ b/lld/test/ELF/linkerscript/extend-pt-load3.test @@ -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. diff --git a/lld/test/ELF/linkerscript/header-phdr.test b/lld/test/ELF/linkerscript/header-phdr.test index 72be15b88a94..866e2d487b31 100644 --- a/lld/test/ELF/linkerscript/header-phdr.test +++ b/lld/test/ELF/linkerscript/header-phdr.test @@ -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 diff --git a/lld/test/ELF/linkerscript/multiple-tbss.s b/lld/test/ELF/linkerscript/multiple-tbss.s index 7b014a5bbeb8..2ac0fd84fd94 100644 --- a/lld/test/ELF/linkerscript/multiple-tbss.s +++ b/lld/test/ELF/linkerscript/multiple-tbss.s @@ -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 diff --git a/lld/test/ELF/linkerscript/overlapping-sections.s b/lld/test/ELF/linkerscript/overlapping-sections.s index 8591d6c83b57..c13ce9259c41 100644 --- a/lld/test/ELF/linkerscript/overlapping-sections.s +++ b/lld/test/ELF/linkerscript/overlapping-sections.s @@ -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 @@ -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 @@ -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 diff --git a/lld/test/ELF/linkerscript/overlay.test b/lld/test/ELF/linkerscript/overlay.test index c9d083fe4b5a..aaa8619a94fc 100644 --- a/lld/test/ELF/linkerscript/overlay.test +++ b/lld/test/ELF/linkerscript/overlay.test @@ -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 diff --git a/lld/test/ELF/linkerscript/symbol-only-align.test b/lld/test/ELF/linkerscript/symbol-only-align.test index fcba618a7563..24da737a6500 100644 --- a/lld/test/ELF/linkerscript/symbol-only-align.test +++ b/lld/test/ELF/linkerscript/symbol-only-align.test @@ -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); diff --git a/lld/test/ELF/linkerscript/ttext-script.s b/lld/test/ELF/linkerscript/ttext-script.s index 673229540bc5..3e75d18f8d77 100644 --- a/lld/test/ELF/linkerscript/ttext-script.s +++ b/lld/test/ELF/linkerscript/ttext-script.s @@ -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 diff --git a/lld/test/ELF/local-symbols-order.s b/lld/test/ELF/local-symbols-order.s index 96130a6e150a..b6db94599715 100644 --- a/lld/test/ELF/local-symbols-order.s +++ b/lld/test/ELF/local-symbols-order.s @@ -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 ... diff --git a/lld/test/ELF/pr36475.s b/lld/test/ELF/pr36475.s index 81884c455fcc..8148b152228b 100644 --- a/lld/test/ELF/pr36475.s +++ b/lld/test/ELF/pr36475.s @@ -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... diff --git a/lld/test/ELF/relocation-copy-relro.s b/lld/test/ELF/relocation-copy-relro.s index 600e46e96785..5f03c6910ab6 100644 --- a/lld/test/ELF/relocation-copy-relro.s +++ b/lld/test/ELF/relocation-copy-relro.s @@ -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) diff --git a/lld/test/ELF/relro.s b/lld/test/ELF/relro.s index 40e37d2aaeb6..163e257e2956 100644 --- a/lld/test/ELF/relro.s +++ b/lld/test/ELF/relro.s @@ -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 diff --git a/lld/test/ELF/ttext-tdata-tbss.s b/lld/test/ELF/ttext-tdata-tbss.s index 1ffe76fd2e58..9637bdd55d04 100644 --- a/lld/test/ELF/ttext-tdata-tbss.s +++ b/lld/test/ELF/ttext-tdata-tbss.s @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/lld/test/ELF/version-script-twice.s b/lld/test/ELF/version-script-twice.s index 1227dcd50f1d..587b7cef01d4 100644 --- a/lld/test/ELF/version-script-twice.s +++ b/lld/test/ELF/version-script-twice.s @@ -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: diff --git a/lld/test/ELF/wrap-dynamic-undef.s b/lld/test/ELF/wrap-dynamic-undef.s index 4d14a806a061..50ada2d5e556 100644 --- a/lld/test/ELF/wrap-dynamic-undef.s +++ b/lld/test/ELF/wrap-dynamic-undef.s @@ -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.