summaryrefslogtreecommitdiffstats
path: root/lld/COFF/Chunks.cpp
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2017-08-14 19:07:27 +0000
committerMartin Storsjo <martin@martin.st>2017-08-14 19:07:27 +0000
commitd2752aa9ecd9e5b47e650a13b027804c65a49ecb (patch)
tree01ff93ec213d6cf574c343a6489f98f456b7c695 /lld/COFF/Chunks.cpp
parent914c836842c6724cc351954ee196e5d935884577 (diff)
downloadbcm5719-llvm-d2752aa9ecd9e5b47e650a13b027804c65a49ecb.tar.gz
bcm5719-llvm-d2752aa9ecd9e5b47e650a13b027804c65a49ecb.zip
[COFF] Add support for aligncomm directives
These are emitted for comm symbols in object files, when targeting a GNU environment. Alternatively, just ignore them since we already align CommonChunk to the natural size of the content (up to 32 bytes). That would only trade away the possibility to overalign small symbols, which doesn't sound like something that might not need to be handled? Differential Revision: https://reviews.llvm.org/D36304 llvm-svn: 310871
Diffstat (limited to 'lld/COFF/Chunks.cpp')
-rw-r--r--lld/COFF/Chunks.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lld/COFF/Chunks.cpp b/lld/COFF/Chunks.cpp
index 297cde2f5ae..43bb4d4c8f2 100644
--- a/lld/COFF/Chunks.cpp
+++ b/lld/COFF/Chunks.cpp
@@ -377,6 +377,10 @@ CommonChunk::CommonChunk(const COFFSymbolRef S) : Sym(S) {
Align = std::min(uint64_t(32), PowerOf2Ceil(Sym.getValue()));
}
+void CommonChunk::setAlign(uint32_t NewAlign) {
+ Align = std::max(Align, NewAlign);
+}
+
uint32_t CommonChunk::getPermissions() const {
return IMAGE_SCN_CNT_UNINITIALIZED_DATA | IMAGE_SCN_MEM_READ |
IMAGE_SCN_MEM_WRITE;
OpenPOWER on IntegriCloud