summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Northover <Tim.Northover@arm.com>2013-01-08 10:12:09 +0000
committerTim Northover <Tim.Northover@arm.com>2013-01-08 10:12:09 +0000
commita269c29e7f7063ee78ff9e98f8607beff2189d5a (patch)
treeea4663e5f6fce6417d9900362229052e54a4c5e8
parentb1304ba9b220ca7874a1c55eb91b1da79a410912 (diff)
downloadbcm5719-llvm-a269c29e7f7063ee78ff9e98f8607beff2189d5a.tar.gz
bcm5719-llvm-a269c29e7f7063ee78ff9e98f8607beff2189d5a.zip
Allow ELF64 relocation type to be more than 8 bits.
Current targets don't have more than 256 relocations so they don't hit this limit, but ELF64 actually allows more than 8 bits for a relocation type. These were being truncated on AArch64. llvm-svn: 171845
-rw-r--r--llvm/include/llvm/Object/ELF.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/include/llvm/Object/ELF.h b/llvm/include/llvm/Object/ELF.h
index 46b62de19e3..735accdf7ec 100644
--- a/llvm/include/llvm/Object/ELF.h
+++ b/llvm/include/llvm/Object/ELF.h
@@ -387,14 +387,14 @@ struct Elf_Rel_Impl<target_endianness, max_alignment, true, isRela>
// These accessors and mutators correspond to the ELF64_R_SYM, ELF64_R_TYPE,
// and ELF64_R_INFO macros defined in the ELF specification:
- uint64_t getSymbol() const { return (r_info >> 32); }
- unsigned char getType() const {
- return (unsigned char) (r_info & 0xffffffffL);
+ uint32_t getSymbol() const { return (uint32_t) (r_info >> 32); }
+ uint32_t getType() const {
+ return (uint32_t) (r_info & 0xffffffffL);
}
- void setSymbol(uint64_t s) { setSymbolAndType(s, getType()); }
- void setType(unsigned char t) { setSymbolAndType(getSymbol(), t); }
- void setSymbolAndType(uint64_t s, unsigned char t) {
- r_info = (s << 32) + (t&0xffffffffL);
+ void setSymbol(uint32_t s) { setSymbolAndType(s, getType()); }
+ void setType(uint32_t t) { setSymbolAndType(getSymbol(), t); }
+ void setSymbolAndType(uint32_t s, uint32_t t) {
+ r_info = ((uint64_t)s << 32) + (t&0xffffffffL);
}
};
@@ -1553,7 +1553,7 @@ error_code ELFObjectFile<target_endianness, max_alignment, is64Bits>
::getRelocationTypeName(DataRefImpl Rel,
SmallVectorImpl<char> &Result) const {
const Elf_Shdr *sec = getSection(Rel.w.b);
- uint8_t type;
+ uint32_t type;
StringRef res;
switch (sec->sh_type) {
default :
OpenPOWER on IntegriCloud