summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2009-06-07 21:22:38 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2009-06-07 21:22:38 +0000
commite577492a17bddf2b57bcc3401d7f0849fd042148 (patch)
tree6dfdebd53323a7316c228a8c85e7f64d913a507c /llvm/include
parent0880e9f58d414d1eb08564795abd274264bd7da1 (diff)
downloadbcm5719-llvm-e577492a17bddf2b57bcc3401d7f0849fd042148.tar.gz
bcm5719-llvm-e577492a17bddf2b57bcc3401d7f0849fd042148.zip
Simple ELF32/64 binary files can now be emitted for x86 and x86_64 without
relocation sections. llvm-svn: 73038
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/Support/OutputBuffer.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/llvm/include/llvm/Support/OutputBuffer.h b/llvm/include/llvm/Support/OutputBuffer.h
index b2077c55143..1adff2d2705 100644
--- a/llvm/include/llvm/Support/OutputBuffer.h
+++ b/llvm/include/llvm/Support/OutputBuffer.h
@@ -134,11 +134,22 @@ namespace llvm {
P[2] = (X >> (isLittleEndian ? 16 : 8)) & 255;
P[3] = (X >> (isLittleEndian ? 24 : 0)) & 255;
}
+ void fixxword(uint64_t X, unsigned Offset) {
+ unsigned char *P = &Output[Offset];
+ P[0] = (X >> (isLittleEndian ? 0 : 56)) & 255;
+ P[1] = (X >> (isLittleEndian ? 8 : 48)) & 255;
+ P[2] = (X >> (isLittleEndian ? 16 : 40)) & 255;
+ P[3] = (X >> (isLittleEndian ? 24 : 32)) & 255;
+ P[4] = (X >> (isLittleEndian ? 32 : 24)) & 255;
+ P[5] = (X >> (isLittleEndian ? 40 : 16)) & 255;
+ P[6] = (X >> (isLittleEndian ? 48 : 8)) & 255;
+ P[7] = (X >> (isLittleEndian ? 56 : 0)) & 255;
+ }
void fixaddr(uint64_t X, unsigned Offset) {
if (!is64Bit)
fixword((unsigned)X, Offset);
else
- assert(0 && "Emission of 64-bit data not implemented yet!");
+ fixxword(X, Offset);
}
unsigned char &operator[](unsigned Index) {
OpenPOWER on IntegriCloud