[all-commits] [llvm/llvm-project] 4f2c46: Print C-string literals in mapfile

Jez Ng via All-commits all-commits at lists.llvm.org
Fri Feb 11 16:42:38 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4f2c46c35ccd17ef726c4b4e8e9500d7972e757a
      https://github.com/llvm/llvm-project/commit/4f2c46c35ccd17ef726c4b4e8e9500d7972e757a
  Author: Roger Kim <rgr at fb.com>
  Date:   2022-02-11 (Fri, 11 Feb 2022)

  Changed paths:
    M lld/MachO/MapFile.cpp
    M lld/test/MachO/map-file.s

  Log Message:
  -----------
  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/D118077


  Commit: dafe4c0b5cd07fa97c1954e0cf21aa90d558578f
      https://github.com/llvm/llvm-project/commit/dafe4c0b5cd07fa97c1954e0cf21aa90d558578f
  Author: Roger Kim <rgr at fb.com>
  Date:   2022-02-11 (Fri, 11 Feb 2022)

  Changed paths:
    M lld/test/MachO/map-file.s

  Log Message:
  -----------
  [Mach-O][NFC] Reorder map file tests

We are just grouping the files and the tests together.

Reviewed By: int3, #lld-macho

Differential Revision: https://reviews.llvm.org/D119456


Compare: https://github.com/llvm/llvm-project/compare/6759cdd82918...dafe4c0b5cd0


More information about the All-commits mailing list