[lld] r257889 - Reapply r257753 with fix:

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 21 11:57:47 PST 2016


On Thu, Jan 21, 2016 at 2:03 AM, George Rimar via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> >> +template <class ELFT>
> >> +void EhFrameHeader<ELFT>::assignEhFrame(EHOutputSection<ELFT> *Sec) {
> >> +  if (this->Sec && this->Sec != Sec) {
> >> +    warning("multiple .eh_frame sections not supported for
> .eh_frame_hdr");
> >> +    Live = false;
> >> +    return;
> >
> >Can this warning ever fire? If not it should be just an assert.
>
> In current code this should never be fired. I was just afraid about future
> changes, I am not sure about what can be done with linkerscript,
> for example and if it is possible to fire it. I think we can replace
> warning + "Live = false" with llvm_unreachable for now then, will it be ok ?
>

If something should never happen unless there is a bug (which is the case),
please use llvm_unreachable(). If it is reachable by doing something bad as
a user (such as giving corrupted files to the linker, passing invalid
options, etc), then use warning() or error().
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160121/3f61b2a6/attachment.html>


More information about the llvm-commits mailing list