This repository has been archived by the owner on Apr 23, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243755 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Showing
4 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |