[PATCH] D47602: Correct aligment computation for shared object symbols
Peter Collingbourne via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 5 14:06:41 PDT 2018
pcc added inline comments.
================
Comment at: ELF/InputFiles.cpp:904
- if (Ret > UINT32_MAX)
- error(toString(this) + ": alignment too large: " +
- CHECK(Sym.getName(this->StringTable), this));
- return Ret;
+ return (Ret > UINT32_MAX) ? 0 : Ret;
}
----------------
ruiu wrote:
> I'm not too excited about change. This error message was to catch a nearly-broken object file that has insanely large alignment requirement. Now you are making a change to ignore such object file.
It should be possible to link against symbols with huge alignments, we just can't create copy relocations for them. So I think you can make `InputFiles.cpp` look more like your previous revision (i.e. return 0 on huge alignments). The check that you've added to `Relocations.cpp` should be enough to make sure that we error out in that case. We don't have to produce a good error message in that case because we expect it to be rare.
https://reviews.llvm.org/D47602
More information about the llvm-commits
mailing list