diff options
author | Martin Storsjo <martin@martin.st> | 2018-07-20 18:43:35 +0000 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2018-07-20 18:43:35 +0000 |
commit | 98ff9f845ded3df23b5c0a6386e3bba96d9bb557 (patch) | |
tree | c2add5dca3b9c0272d16fc8ffd622f4e47114b62 /llvm/lib/Demangle/MicrosoftDemangle.cpp | |
parent | d463453d815bee1d69739ba94934ffc7f538e97f (diff) | |
download | bcm5719-llvm-98ff9f845ded3df23b5c0a6386e3bba96d9bb557.tar.gz bcm5719-llvm-98ff9f845ded3df23b5c0a6386e3bba96d9bb557.zip |
[COFF] Sort .reloc before all other discardable sections
If a binary is stripped, which can remove discardable sections (except
for the .reloc section, which also is marked as discardable as it isn't
loaded at runtime, only read by the loader), the .reloc section should
be first of them, in order not to create gaps in the image.
Previously, binaries with relocations were broken if they were stripped
by GNU binutils strip. Trying to execute such binaries produces an error
about "xx is not a valid win32 application".
This fixes GNU binutils bug 23348.
Prior to SVN r329370 (which didn't intend to have functional changes),
the code for moving discardable sections to the end didn't clearly
express how other discardable sections should be ordered compared to
.reloc, but the change retained the exact same end result as before.
After SVN r329370, the code (and comments) more clearly indicate that
it tries to make the .reloc section the absolutely last one; this patch
changes that.
This matches how GNU binutils ld sorts .reloc compared to dwarf debug
info sections.
Differential Revision: https://reviews.llvm.org/D49351
Signed-off-by: Martin Storsjö <martin@martin.st>
llvm-svn: 337598
Diffstat (limited to 'llvm/lib/Demangle/MicrosoftDemangle.cpp')
0 files changed, 0 insertions, 0 deletions