summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-05-22 15:43:00 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-05-22 15:43:00 +0000
commit62a07cb59b432f9539eb2bb34b9a1c5e44016b7c (patch)
treeda49ad104c5e37c7a9c6d19f50d4dbc886f26e10 /llvm/test
parentf692ef9e472e40b7d7d38ddf4acec3914bf92440 (diff)
downloadbcm5719-llvm-62a07cb59b432f9539eb2bb34b9a1c5e44016b7c.tar.gz
bcm5719-llvm-62a07cb59b432f9539eb2bb34b9a1c5e44016b7c.zip
Stop inventing symbol sizes.
MachO and COFF quite reasonably only define the size for common symbols. We used to try to figure out the "size" by computing the gap from one symbol to the next. This would not be correct in general, since a part of a section can belong to no visible symbol (padding, private globals). It was also really expensive, since we would walk every symbol to find the size of one. If a caller really wants this, it can sort all the symbols once and get all the gaps ("size") in O(n log n) instead of O(n^2). On MachO this also has the advantage of centralizing all the checks for an invalid n_sect. llvm-svn: 238028
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Object/Inputs/macho-invalid-getsection-indexbin316 -> 0 bytes
-rw-r--r--llvm/test/Object/Inputs/macho64-invalid-getsection-indexbin4536 -> 0 bytes
-rw-r--r--llvm/test/Object/macho-invalid.test9
-rw-r--r--llvm/test/Object/objdump-symbol-table.test2
-rw-r--r--llvm/test/tools/llvm-objdump/X86/macho-symbol-table.test8
5 files changed, 5 insertions, 14 deletions
diff --git a/llvm/test/Object/Inputs/macho-invalid-getsection-index b/llvm/test/Object/Inputs/macho-invalid-getsection-index
deleted file mode 100644
index b7e4b95bc9b..00000000000
--- a/llvm/test/Object/Inputs/macho-invalid-getsection-index
+++ /dev/null
Binary files differ
diff --git a/llvm/test/Object/Inputs/macho64-invalid-getsection-index b/llvm/test/Object/Inputs/macho64-invalid-getsection-index
deleted file mode 100644
index a2a7bc10c4f..00000000000
--- a/llvm/test/Object/Inputs/macho64-invalid-getsection-index
+++ /dev/null
Binary files differ
diff --git a/llvm/test/Object/macho-invalid.test b/llvm/test/Object/macho-invalid.test
index dae5c4eda7e..e2c9b6b7360 100644
--- a/llvm/test/Object/macho-invalid.test
+++ b/llvm/test/Object/macho-invalid.test
@@ -28,13 +28,6 @@ RUN: | FileCheck -check-prefix NAME-PAST-EOF %s
RUN: not llvm-nm %p/Inputs/macho-invalid-section-index-getSectionRawName 2>&1 \
RUN: | FileCheck -check-prefix INVALID-SECTION-IDX-SYMBOL-SEC %s
-RUN: not llvm-objdump -t %p/Inputs/macho-invalid-getsection-index 2>&1 \
-RUN: | FileCheck -check-prefix INVALID-SECTION-IDX-GETSECT %s
-
-RUN: not llvm-objdump -t %p/Inputs/macho64-invalid-getsection-index 2>&1 \
-RUN: | FileCheck -check-prefix INVALID-SECTION-IDX-GETSECT64 %s
-
-
SMALL-LOADC-SIZE: Load command with size < 8 bytes
SMALL-SEGLOADC-SIZE: Segment load command size is too small
INCOMPLETE-LOADC: Malformed MachO file
@@ -43,5 +36,3 @@ BAD-SYMBOL: Requested symbol index is out of range
NAME-PAST-EOF: Symbol name entry points before beginning or past end of file
INVALID-SECTION-IDX-SYMBOL-SEC: getSymbolSection: Invalid section index
-INVALID-SECTION-IDX-GETSECT: getSection: Invalid section index
-INVALID-SECTION-IDX-GETSECT64: getSection64: Invalid section index
diff --git a/llvm/test/Object/objdump-symbol-table.test b/llvm/test/Object/objdump-symbol-table.test
index 07109176638..3d09e1a45f3 100644
--- a/llvm/test/Object/objdump-symbol-table.test
+++ b/llvm/test/Object/objdump-symbol-table.test
@@ -30,7 +30,7 @@ ELF-i386: 00000000 *UND* 00000000 puts
macho-i386: trivial-object-test.macho-i386: file format Mach-O 32-bit i386
macho-i386: SYMBOL TABLE:
-macho-i386: 00000000 g F __TEXT,__text 00000024 _main
+macho-i386: 00000000 g F __TEXT,__text 00000000 _main
macho-i386: 00000000 *UND* 00000000 _SomeOtherFunction
macho-i386: 00000000 *UND* 00000000 _puts
diff --git a/llvm/test/tools/llvm-objdump/X86/macho-symbol-table.test b/llvm/test/tools/llvm-objdump/X86/macho-symbol-table.test
index 5b9a4f84976..3fe5aea6c37 100644
--- a/llvm/test/tools/llvm-objdump/X86/macho-symbol-table.test
+++ b/llvm/test/tools/llvm-objdump/X86/macho-symbol-table.test
@@ -1,8 +1,8 @@
RUN: llvm-objdump -macho -t %p/Inputs/hello.obj.macho-x86_64 | FileCheck %s
CHECK: SYMBOL TABLE:
-CHECK: 000000000000003b l F __TEXT,__cstring 0000000d L_.str
-CHECK: 0000000000000068 l F __TEXT,__eh_frame 00000018 EH_frame0
-CHECK: 0000000000000000 g F __TEXT,__text 0000003b _main
-CHECK: 0000000000000080 g F __TEXT,__eh_frame 00000028 _main.eh
+CHECK: 000000000000003b l F __TEXT,__cstring 00000000 L_.str
+CHECK: 0000000000000068 l F __TEXT,__eh_frame 00000000 EH_frame0
+CHECK: 0000000000000000 g F __TEXT,__text 00000000 _main
+CHECK: 0000000000000080 g F __TEXT,__eh_frame 00000000 _main.eh
CHECK: 0000000000000000 *UND* 00000000 _printf
OpenPOWER on IntegriCloud