[PATCH] D70020: [lld] Better support for group semantic wrt. notes

serge via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 12 01:21:07 PST 2019


serge-sans-paille added a comment.

> "to respect the group semantic" is not accurate. The ELF specification does not have such rules. I think this is more of a GNU ld --gc-sections semantic (not even implemented in gold). It seems that when GNU ld decides to discard a SHF_ALLOC section in a comdat group, it discards non-SHF_ALLOC sections in the group as well. The section type does not seem to matter. If we rename `.note..text.foo` (is double-dot `..` the intention?) to `.aaa`, and change its type from SHT_NOTE to SHT_PROGBITS, we will get the same observations. Knowing the rules used by GNU ld will be helpful.

I was basing my comment on https://docs.oracle.com/cd/E19120-01/open.solaris/819-0690/chapter7-26/index.html

> There can be internal references among group sections. However, these references make no sense if one of the sections were removed, or one of the sections were replaced by a duplicate from another object. Therefore, these groups are included, or these groups are omitted, from the linked object as a unit.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70020/new/

https://reviews.llvm.org/D70020





More information about the llvm-commits mailing list