Commit Graph

9 Commits

Author SHA1 Message Date
Rafael Espindola c404d50d7c Merge InputSectionData and InputSectionBase.
Now that InputSectionBase is not a template there is no reason to have
the two.

llvm-svn: 295924
2017-02-23 02:32:18 +00:00
Rafael Espindola b4c9b81aad Convert InputSectionBase to a class.
Removing this template is not a big win by itself, but opens the way
for removing more templates.

llvm-svn: 295923
2017-02-23 02:28:28 +00:00
Rui Ueyama eb1ad400f9 Print alignment in decimal instead of hexadecimal.
Previously, we were printing out something like this for
sections/symbols with alignment 16

  0000000000201000 0000000000000182    10 .data

which I think confusing. I think printing it in decimal is better.

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

llvm-svn: 293685
2017-01-31 20:42:34 +00:00
George Rimar 07d94e3529 [ELF] - Fix format specifiers in writeOutSecLine()
I had a error in map-file.s testcase under MSVS2015/win32:

map-file.s:30:16: error: expected string not found in input
// CHECK-NEXT: 0000000000200158 0000000000000030 8 .eh_frame

<stdin>:2:1: note: scanning from here
0000000000200158 10 30 .eh_frame

Format string '%0*x' requires an argument of type 'unsigned int',
but argument has type 'uint64_t'. Proper format is '%0*llx' then.

This fixes testcase failture for me.

llvm-svn: 292102
2017-01-16 11:35:38 +00:00
Rui Ueyama c9807c3370 Use error() instead of fatal() to handle file open error.
llvm-svn: 292090
2017-01-16 01:07:19 +00:00
Rui Ueyama 483ffa3365 Simplify string output. NFC.
llvm-svn: 292042
2017-01-15 01:11:47 +00:00
Rui Ueyama 543731f96a Directly write to a -Map file.
Previous code had a bug that if the program exits with an assert() or
fail() before the control reaches end of writeMapFile(), it leaves a
temporary file, because FileRemover's dtor isn't called in that case.

I could fix that by removeFileOnSignal() and other functions, but
I think we can simply write to the result file directly. I think
that is straightforward and easy to understand.

Additionally, that allows something like `-Map /dev/null` or a bash
hack such as `-Map >(grep symbol-im-looking-for)`. Previously,
that kind of things didn't work.

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

llvm-svn: 292041
2017-01-15 00:41:21 +00:00
Rui Ueyama db540ff057 Split writeMapFile2 to reduce indentation level.
llvm-svn: 291984
2017-01-14 00:37:28 +00:00
Rafael Espindola 1ebfc59c89 Implement -Map.
The format is not exactly the same as the one in bfd since bfd always
follows a linker script and prints it along.

llvm-svn: 291958
2017-01-13 21:05:46 +00:00