[PATCH] D44894: [ELF] - Reveal more information in -Map file about assignments.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 26 06:05:06 PDT 2018


grimar created this revision.
grimar added reviewers: ruiu, espindola.
Herald added subscribers: arichardson, emaste.

Currently, LLD print symbol assignment commands to the map file,
but it does not do that for assignments that are outside of the section
descriptions. Such assignments can affect the layout though.

The patch implements the following:

1. Teaches LLD to print symbol assignments outside of section declaration.
2. Teaches LLD to print PROVIDE/HIDDEN/PROVIDE hidden commands.

In case when symbol is not provided, nothing will be printed.

Second part slightly differs from gold. It prints information about all
symbols to the map file (both about provided and not provided):

  .bar3       0x0000000000000030        0x8 test.o
                 [!provide]                        PROVIDE (sym4 = 0x2a)
                 0x000000000000002a     PROVIDE (sym3 = 0x2a)

I think it probably does not make much sense to print not-provided
symbols, so patch ignores them. (Though it would be easy to print them too).


https://reviews.llvm.org/D44894

Files:
  ELF/LinkerScript.cpp
  ELF/LinkerScript.h
  ELF/MapFile.cpp
  ELF/ScriptParser.cpp
  test/ELF/linkerscript/map-file.test

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44894.139780.patch
Type: text/x-patch
Size: 8526 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180326/dda27c8e/attachment.bin>


More information about the llvm-commits mailing list