[PATCH] D24750: [GC] Don't crash while processing Discarded sections

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 20 15:32:24 PDT 2016


ruiu added a comment.

Quote from https://docs.oracle.com/cd/E23824_01/html/819-0690/chapter7-26.html:

  References to the sections comprising a group from sections outside of the group must be made through symbol table entries with STB_GLOBAL or STB_WEAK binding and section index SHN_UNDEF.

comdat.s contains relocations directly referring a section comprising a comdat group from outside of the group, so it is an invalid object file as per the ELF spec. Even with this change, comdat.s wouldn't be linked properly because it has a dangling relocation that points to a dedup'ed (and removed) section.

So even though we might want to add an error check here (I'm not sure if we really want it though), I think ignoring the error here is not a right thing.


https://reviews.llvm.org/D24750





More information about the llvm-commits mailing list