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:
- Teaches LLD to print symbol assignments outside of section declaration.
- 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).