diff options
author | Reid Kleckner <reid@kleckner.net> | 2015-07-31 16:14:22 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2015-07-31 16:14:22 +0000 |
commit | 47ea9ece1a17735d4f57f3dd84d86b9102b752cf (patch) | |
tree | 3fbd60e0282ba9d8df6aa000a6dedb7e93ee1c60 /llvm/test/Object | |
parent | bb42b030219710676ecb224bd3748641ff828c86 (diff) | |
download | bcm5719-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-x | llvm/test/Object/Inputs/main-ret-zero-pe-i386.dll | bin | 0 -> 5120 bytes | |||
-rwxr-xr-x | llvm/test/Object/Inputs/main-ret-zero-pe-i386.exe | bin | 0 -> 5120 bytes | |||
-rw-r--r-- | llvm/test/Object/nm-pe-image.test | 31 |
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 Binary files differnew file mode 100755 index 00000000000..d4a343088b1 --- /dev/null +++ b/llvm/test/Object/Inputs/main-ret-zero-pe-i386.dll diff --git a/llvm/test/Object/Inputs/main-ret-zero-pe-i386.exe b/llvm/test/Object/Inputs/main-ret-zero-pe-i386.exe Binary files differnew file mode 100755 index 00000000000..366767b9b77 --- /dev/null +++ b/llvm/test/Object/Inputs/main-ret-zero-pe-i386.exe 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 |