Commit 4f2c46c
Print C-string literals in mapfile
This diff has the C-string literals printed into the mapfile in the symbol table like how ld64 does.
Here is what ld64's mapfile looks like with C-string literals:
```
# Path: out
# Arch: x86_64
# Object files:
[ 0] linker synthesized
[ 1] foo.o
# Sections:
# Address Size Segment Section
0x100003F7D 0x0000001D __TEXT __text
0x100003F9A 0x0000001E __TEXT __cstring
0x100003FB8 0x00000048 __TEXT __unwind_info
# Symbols:
# Address Size File Name
0x100003F7D 0x0000001D [ 1] _main
0x100003F9A 0x0000000E [ 1] literal string: Hello world!\n
0x100003FA8 0x00000010 [ 1] literal string: Hello, it's me\n
0x100003FB8 0x00000048 [ 0] compact unwind info
```
Here is what the new lld's Mach-O mapfile looks like:
```
# Path: /Users/rgr/local/llvm-project/build/Debug/tools/lld/test/MachO/Output/map-file.s.tmp/c-string-liter
al-out
# Arch: x86_64
# Object files:
[ 0] linker synthesized
[ 1] /Users/rgr/local/llvm-project/build/Debug/tools/lld/test/MachO/Output/map-file.s.tmp/c-string-literal
.o
# Sections:
# Address Size Segment Section
0x1000002E0 0x0000001D __TEXT __text
0x1000002FD 0x0000001D __TEXT __cstring
# Symbols:
# Address File Name
0x1000002E0 [ 1] _main
0x1000002FD [ 1] literal string: Hello world!\n
0x10000030B [ 1] literal string: Hello, it's me\n
```
Reviewed By: #lld-macho, int3
Differential Revision: https://reviews.llvm.org/D1180771 parent 6759cdd commit 4f2c46c
2 files changed
+61
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
79 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
80 | 101 | | |
81 | 102 | | |
82 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
54 | 93 | | |
0 commit comments