summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Haarman <llvm@inglorion.net>2017-01-13 22:05:22 +0000
committerBob Haarman <llvm@inglorion.net>2017-01-13 22:05:22 +0000
commit848c569734978f5087b8ef64b54cd206cd6d704e (patch)
tree1b4b0459cb3857685be908f698871b28a542eb98
parentb1e7a12ee89ffcf50d0b18f8c6da7423604ea9d8 (diff)
downloadbcm5719-llvm-848c569734978f5087b8ef64b54cd206cd6d704e.tar.gz
bcm5719-llvm-848c569734978f5087b8ef64b54cd206cd6d704e.zip
COFF: include relocation type in unsupported relocation message
Summary: When we encouter a relocation type we don't know how to handle, this change causes us to print out the hexadecimal value of the relocation type. This makes troubleshooting a little easier. Reviewers: ruiu, zturner Differential Revision: https://reviews.llvm.org/D28576 llvm-svn: 291962
-rw-r--r--lld/COFF/Chunks.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lld/COFF/Chunks.cpp b/lld/COFF/Chunks.cpp
index 7f0dfa92ec1..16a477a2652 100644
--- a/lld/COFF/Chunks.cpp
+++ b/lld/COFF/Chunks.cpp
@@ -11,6 +11,7 @@
#include "Error.h"
#include "InputFiles.h"
#include "Symbols.h"
+#include "llvm/ADT/Twine.h"
#include "llvm/Object/COFF.h"
#include "llvm/Support/COFF.h"
#include "llvm/Support/Debug.h"
@@ -61,7 +62,7 @@ void SectionChunk::applyRelX64(uint8_t *Off, uint16_t Type, Defined *Sym,
case IMAGE_REL_AMD64_SECTION: add16(Off, Sym->getSectionIndex()); break;
case IMAGE_REL_AMD64_SECREL: add32(Off, Sym->getSecrel()); break;
default:
- fatal("unsupported relocation type");
+ fatal("unsupported relocation type 0x" + Twine::utohexstr(Type));
}
}
@@ -76,7 +77,7 @@ void SectionChunk::applyRelX86(uint8_t *Off, uint16_t Type, Defined *Sym,
case IMAGE_REL_I386_SECTION: add16(Off, Sym->getSectionIndex()); break;
case IMAGE_REL_I386_SECREL: add32(Off, Sym->getSecrel()); break;
default:
- fatal("unsupported relocation type");
+ fatal("unsupported relocation type 0x" + Twine::utohexstr(Type));
}
}
@@ -136,7 +137,7 @@ void SectionChunk::applyRelARM(uint8_t *Off, uint16_t Type, Defined *Sym,
case IMAGE_REL_ARM_BLX23T: applyBranch24T(Off, S - P - 4); break;
case IMAGE_REL_ARM_SECREL: add32(Off, Sym->getSecrel()); break;
default:
- fatal("unsupported relocation type");
+ fatal("unsupported relocation type 0x" + Twine::utohexstr(Type));
}
}
OpenPOWER on IntegriCloud