From 26b10da9c2b9b22418ca532bfb50274b2556eb53 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 23 Jul 2013 10:47:01 +0000 Subject: Add an initial implementation of archive symbol table generation. The symbol table has forward references in the file. Instead of allocating a temporary buffer or counting the size and then writing, this implementation writes a dummy value first and patches it once the final value is known. There is room for performance improvement. I will implement them as soon as I get some other features (like a ranlib mode) in. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186934 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Object/Inputs/trivial-object-test2.elf-x86-64 | Bin 0 -> 1424 bytes test/Object/archive-symtab.test | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 test/Object/Inputs/trivial-object-test2.elf-x86-64 create mode 100644 test/Object/archive-symtab.test (limited to 'test/Object') diff --git a/test/Object/Inputs/trivial-object-test2.elf-x86-64 b/test/Object/Inputs/trivial-object-test2.elf-x86-64 new file mode 100644 index 0000000..9124518 Binary files /dev/null and b/test/Object/Inputs/trivial-object-test2.elf-x86-64 differ diff --git a/test/Object/archive-symtab.test b/test/Object/archive-symtab.test new file mode 100644 index 0000000..1cf0ce4 --- /dev/null +++ b/test/Object/archive-symtab.test @@ -0,0 +1,18 @@ +RUN: rm -f %t.a +RUN: llvm-ar rcs %t.a %p/Inputs/trivial-object-test.elf-x86-64 %p/Inputs/trivial-object-test2.elf-x86-64 +RUN: llvm-nm -s %t.a | FileCheck %s + +CHECK: Archive map +CHECK-NEXT: main in trivial-object-test.elf-x86-64 +CHECK-NEXT: foo in trivial-object-test2.elf-x86-64 +CHECK-NEXT: main in trivial-object-test2.elf-x86-64 +CHECK-NOT: bar + +CHECK: trivial-object-test.elf-x86-64: +CHECK-NEXT: U SomeOtherFunction +CHECK-NEXT: 00000000 T main +CHECK-NEXT: U puts +CHECK-NEXT: trivial-object-test2.elf-x86-64: +CHECK-NEXT: 00000000 t bar +CHECK-NEXT: 00000006 T foo +CHECK-NEXT: 00000016 T main -- cgit v1.1