[lld] 14bb6e4 - Revert "[lld/mac] Add tests for the interaction between -rename_section and -rename_segment"
Nico Weber via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 25 15:11:57 PDT 2021
Author: Nico Weber
Date: 2021-07-25T18:11:36-04:00
New Revision: 14bb6e4d709cd5aa70637b389c919ceed6cd83a5
URL: https://github.com/llvm/llvm-project/commit/14bb6e4d709cd5aa70637b389c919ceed6cd83a5
DIFF: https://github.com/llvm/llvm-project/commit/14bb6e4d709cd5aa70637b389c919ceed6cd83a5.diff
LOG: Revert "[lld/mac] Add tests for the interaction between -rename_section and -rename_segment"
This reverts commit a6eb34624dcfa5a33caa0211f4a16710b22079c2.
The test fails, I screwed something up.
Added:
Modified:
lld/test/MachO/rename.s
Removed:
################################################################################
diff --git a/lld/test/MachO/rename.s b/lld/test/MachO/rename.s
index 94c3afdec7e25..58144f05df79b 100644
--- a/lld/test/MachO/rename.s
+++ b/lld/test/MachO/rename.s
@@ -1,11 +1,9 @@
# REQUIRES: x86
+# RUN: rm -fr %t
+# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
+# RUN: %lld -o %t %t.o
-# RUN: rm -rf %t; split-file %s %t
-
-# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/main.s -o %t.o
-# RUN: %lld -o %t.out %t.o
-
-## Check option format.
+## Check option format
# RUN: not %lld \
# RUN: -rename_section B at GUS_SEG b at gus_sect S/ASHY_SEG st*rry_sect \
# RUN: -rename_section __FROM_SECT __from_sect __TO_SECT \
@@ -28,13 +26,13 @@
# BAD2-DAG: error: invalid name for segment or section: -o
# BAD2-DAG: error: {{.*}}: unhandled file type
-## Check that section and segment renames happen.
-# RUN: %lld -lSystem \
+## Check that section and segment renames happen
+# RUN: %lld \
# RUN: -rename_section __FROM_SECT __from_sect __TO_SECT __to_sect \
# RUN: -rename_segment __FROM_SEG __TO_SEG \
# RUN: -rename_section __TEXT __cstring __RODATA __cstring \
-# RUN: -o %t.out %t.o
-# RN: llvm-otool -l %t.out | FileCheck %s
+# RUN: -o %t %t.o
+# RUN: llvm-objdump --macho --all-headers %t | FileCheck %s
# CHECK: {{^}}Section{{$}}
# CHECK-NEXT: sectname __text
@@ -49,62 +47,6 @@
# CHECK-NEXT: sectname __cstring
# CHECK-NEXT: segname __RODATA
-## Check interaction between -rename_section and -rename_segment.
-## rename_segment should be applied after rename_section, so the output
-## name of rename_section is renamed by rename_segment.
-## (ld64 leaves an empty __TO_SECT,__to_sect in the output for the intermediate
-## name, but it too writes the actual data to __SEG,__to_sect.)
-# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/small.s \
-# RUN: -o %t/small.o
-# RUN: %lld -dylib \
-# RUN: -rename_section __FROM_SECT __from_sect __TO_SECT __to_sect \
-# RUN: -rename_segment __TO_SECT __SEG \
-# RUN: -o %t.dylib %t/small.o
-# RUN: llvm-otool -l %t.dylib | FileCheck --check-prefix=SECTSEGYES %s
-# RUN: %lld -dylib \
-# RUN: -rename_segment __TO_SECT __SEG \
-# RUN: -rename_section __FROM_SECT __from_sect __TO_SECT __to_sect \
-# RUN: -o %t.dylib %t/small.o
-# RUN: llvm-otool -l %t.dylib | FileCheck --check-prefix=SECTSEGYES %s
-# SECTSEGYES: Section
-# SECTSEGYES-NEXT: sectname __text
-# SECTSEGYES-NEXT: segname __TEXT
-# SECTSEGYES: Section
-# SECTSEGYES-NEXT: sectname __to_sect
-# SECTSEGYES-NEXT: segname __SEG
-## ...but rename_segment has no effect if it doesn't match the name after
-## rename_section is applied.
-# RUN: %lld -dylib \
-# RUN: -rename_section __FROM_SECT __from_sect __TO_SECT __to_sect \
-# RUN: -rename_segment __FROM_SECT __SEG \
-# RUN: -o %t.dylib %t/small.o
-# RUN: llvm-otool -l %t.dylib | FileCheck --check-prefix=SECTSEGSOME %s
-# SECTSEGSOME: Section
-# SECTSEGSOME-NEXT: sectname __text
-# SECTSEGSOME-NEXT: segname __TEXT
-# SECTSEGSOME: Section
-# SECTSEGSOME-NEXT: sectname __to_sect
-# SECTSEGSOME-NEXT: segname __TO_SECT
-## If rename_section would only match after rename_segment, rename_section has
-## no effect.
-# RUN: %lld -dylib \
-# RUN: -rename_section __SEG __from_sect __TO_SECT __to_sect \
-# RUN: -rename_segment __FROM_SECT __SEG \
-# RUN: -o %t.dylib %t/small.o
-# RUN: llvm-otool -l %t.dylib | FileCheck --check-prefix=SECTSEGNO %s
-# RUN: %lld -dylib \
-# RUN: -rename_segment __FROM_SECT __SEG \
-# RUN: -rename_section __SEG __from_sect __TO_SECT __to_sect \
-# RUN: -o %t.dylib %t/small.o
-# RUN: llvm-otool -l %t.dylib | FileCheck --check-prefix=SECTSEGNO %s
-# SECTSEGNO: Section
-# SECTSEGNO-NEXT: sectname __text
-# SECTSEGNO-NEXT: segname __TEXT
-# SECTSEGNO: Section
-# SECTSEGNO-NEXT: sectname __from_sect
-# SECTSEGNO-NEXT: segname __SEG
-
-#--- main.s
.section __FROM_SECT,__from_sect
.global _from_sect
_from_sect:
@@ -123,9 +65,3 @@ _from_seg:
.global _main
_main:
ret
-
-#--- small.s
-.section __FROM_SECT,__from_sect
-.global _from_sect
-_from_sect:
- .space 8
More information about the llvm-commits
mailing list