summaryrefslogtreecommitdiffstats
path: root/llvm/test/Object
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2015-07-31 16:14:22 +0000
committerReid Kleckner <reid@kleckner.net>2015-07-31 16:14:22 +0000
commit47ea9ece1a17735d4f57f3dd84d86b9102b752cf (patch)
tree3fbd60e0282ba9d8df6aa000a6dedb7e93ee1c60 /llvm/test/Object
parentbb42b030219710676ecb224bd3748641ff828c86 (diff)
downloadbcm5719-llvm-47ea9ece1a17735d4f57f3dd84d86b9102b752cf.tar.gz
bcm5719-llvm-47ea9ece1a17735d4f57f3dd84d86b9102b752cf.zip
[COFF] Return symbol VAs instead of RVAs for PE files
This makes llvm-nm consistent with binutils nm on executables and DLLs. For a vanilla hello world executable, the address of main should include the default image base of 0x400000. llvm-svn: 243755
Diffstat (limited to 'llvm/test/Object')
-rwxr-xr-xllvm/test/Object/Inputs/main-ret-zero-pe-i386.dllbin0 -> 5120 bytes
-rwxr-xr-xllvm/test/Object/Inputs/main-ret-zero-pe-i386.exebin0 -> 5120 bytes
-rw-r--r--llvm/test/Object/nm-pe-image.test31
3 files changed, 31 insertions, 0 deletions
diff --git a/llvm/test/Object/Inputs/main-ret-zero-pe-i386.dll b/llvm/test/Object/Inputs/main-ret-zero-pe-i386.dll
new file mode 100755
index 00000000000..d4a343088b1
--- /dev/null
+++ b/llvm/test/Object/Inputs/main-ret-zero-pe-i386.dll
Binary files differ
diff --git a/llvm/test/Object/Inputs/main-ret-zero-pe-i386.exe b/llvm/test/Object/Inputs/main-ret-zero-pe-i386.exe
new file mode 100755
index 00000000000..366767b9b77
--- /dev/null
+++ b/llvm/test/Object/Inputs/main-ret-zero-pe-i386.exe
Binary files differ
diff --git a/llvm/test/Object/nm-pe-image.test b/llvm/test/Object/nm-pe-image.test
new file mode 100644
index 00000000000..f95aeebf727
--- /dev/null
+++ b/llvm/test/Object/nm-pe-image.test
@@ -0,0 +1,31 @@
+The executable was generated like so:
+$ cat t.c
+int main() { return 0; }
+$ clang --target=i686-windows -c t.c -o t.o
+$ lld-link2 t.o -out:t.exe -entry:main -debug
+
+It has a mingw-style symbol table in the executable, which MSVC-produced images
+don't have.
+
+RUN: llvm-nm %p/Inputs/main-ret-zero-pe-i386.exe \
+RUN: | FileCheck %s -check-prefix PE-EXE
+
+PE-EXE: 00401000 t .bss
+PE-EXE: 00401000 t .data
+PE-EXE: 00401000 t .text
+PE-EXE: 00401000 T _main
+
+The DLL was generated like so:
+$ cat t.c
+int DllMain(void *mod, long reason, void *reserved) { return 1; }
+$ clang --target=i686-windows -c t.c -o t.o
+$ lld-link2 t.o -out:t.exe -entry:DllMain -debug -dll
+
+
+RUN: llvm-nm %p/Inputs/main-ret-zero-pe-i386.dll \
+RUN: | FileCheck %s -check-prefix PE-DLL
+
+PE-DLL: 10001000 t .bss
+PE-DLL: 10001000 t .data
+PE-DLL: 10001000 t .text
+PE-DLL: 10001000 T _DllMain
OpenPOWER on IntegriCloud