[PATCH] D54495: [LLD] [COFF] Remove empty sections before calculating the size of section headers
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 13 21:41:19 PST 2018
ruiu added inline comments.
================
Comment at: COFF/Writer.cpp:888-892
+ auto IsEmpty = [](OutputSection *S) {
+ for (Chunk *C : S->Chunks)
+ if (C->getSize() > 0)
+ return false;
+ return true;
----------------
It feels like `S->getVirtualSize()` should return 0 if all sections in it are empty. Can you fix the code computing output section size instead of computing a bogus value as a size and then remove such section here?
Repository:
rLLD LLVM Linker
https://reviews.llvm.org/D54495
More information about the llvm-commits
mailing list