diff options
author | Rui Ueyama <ruiu@google.com> | 2017-04-25 16:00:44 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2017-04-25 16:00:44 +0000 |
commit | 577168ecdeadbb991dabf16d7879f31f73b9901d (patch) | |
tree | ba400d847371c560fb0e8e131301beb4ce89a21a /lld/ELF/OutputSections.cpp | |
parent | 4800fc4363167ec57a8ae0e5be5de63c3028d4ab (diff) | |
download | bcm5719-llvm-577168ecdeadbb991dabf16d7879f31f73b9901d.tar.gz bcm5719-llvm-577168ecdeadbb991dabf16d7879f31f73b9901d.zip |
[ELF] Improve error message for incompatible section flags
Previously we were not printing out the flags of the incompatible
section which made it difficult to determine what the problem was.
The error message format has been change to the following:
error: incompatible section flags for .bar
>>> /foo/bar/incompatible-section-flags.s.tmp.o:(.bar): 0x403
>>> output section .bar: 0x3
Patch by Alexander Richardson.
Differential Revision: https://reviews.llvm.org/D32484
llvm-svn: 301319
Diffstat (limited to 'lld/ELF/OutputSections.cpp')
-rw-r--r-- | lld/ELF/OutputSections.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp index a40818d2d30..71fc00ac35e 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -405,8 +405,10 @@ void OutputSectionFactory::addInputSec(InputSectionBase *IS, OutputSection *&Sec = Map[Key]; if (Sec) { if (getIncompatibleFlags(Sec->Flags) != getIncompatibleFlags(IS->Flags)) - error("Section has flags incompatible with others with the same name " + - toString(IS)); + error("incompatible section flags for " + Sec->Name + + "\n>>> " + toString(IS) + ": 0x" + utohexstr(IS->Flags) + + "\n>>> output section " + Sec->Name + ": 0x" + + utohexstr(Sec->Flags)); if (Sec->Type != IS->Type) { if (canMergeToProgbits(Sec->Type) && canMergeToProgbits(IS->Type)) Sec->Type = SHT_PROGBITS; |