summaryrefslogtreecommitdiffstats
path: root/llvm/test/Object/Inputs
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2018-01-12 22:09:19 +0000
committerRui Ueyama <ruiu@google.com>2018-01-12 22:09:19 +0000
commit6371180cd4957875abb0293efc1f07d7392b82a7 (patch)
treecf67cc6d0cdf46c89e3d8f3ca5d8bcb0e3b3facc /llvm/test/Object/Inputs
parent5cdf0383741fadeec1896b624648eff3689a8d2d (diff)
downloadbcm5719-llvm-6371180cd4957875abb0293efc1f07d7392b82a7.tar.gz
bcm5719-llvm-6371180cd4957875abb0293efc1f07d7392b82a7.zip
Allow unaligned access to ELF file data structures.
The ELF specification says that all ELF data structures are aligned to their natural alignments both in memory and file. That means when we access mmap'ed ELF files, we could assume that all data structures are aligned properly. However, in reality, we assume that the data structures are aligned only to two bytes because .a files only guarantee that their member files are aligned to two bytes in archive files. So the data access is already unaligned. This patch relaxes the alignment requirement even more, so that we accept unaligned access to all ELF data structures. This patch in particular makes lld bug-compatible with icc. Intel C compiler doesn't seem to care about data alignment and generates unaligned relocation sections (https://bugs.llvm.org/show_bug.cgi?id=35854). I also saw another instance of compatibility issues with our internal tool which creates unaligned section headers. Because GNU linkers are not picky about alignment, looks like it is not uncommon that ELF-generating tools create unaligned files. There is a performance penalty with this patch on host machines on which unaligned access is expensive. x86 and AArch64 are fine. ARMv6 is a problem, but I don't think using ARMv6 machines as hosts is common, so I believe it's not a real problem. Differential Revision: https://reviews.llvm.org/D41978 llvm-svn: 322407
Diffstat (limited to 'llvm/test/Object/Inputs')
-rw-r--r--llvm/test/Object/Inputs/invalid-sections-address-alignment.x86-64bin473 -> 0 bytes
1 files changed, 0 insertions, 0 deletions
diff --git a/llvm/test/Object/Inputs/invalid-sections-address-alignment.x86-64 b/llvm/test/Object/Inputs/invalid-sections-address-alignment.x86-64
deleted file mode 100644
index c0653d1d1b3..00000000000
--- a/llvm/test/Object/Inputs/invalid-sections-address-alignment.x86-64
+++ /dev/null
Binary files differ
OpenPOWER on IntegriCloud