[PATCH] D96914: [ELF] Add -z start-stop-gc to let __start_/__stop_ not retain C identifier name sections

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 23 01:04:56 PST 2021


MaskRay added a comment.

In D96914#2576107 <https://reviews.llvm.org/D96914#2576107>, @emaste wrote:

> See also https://bugs.llvm.org/show_bug.cgi?id=22906

It does not link to a usage requiring the rule `__start_/__stop_ references retain non-SHF_LINK_ORDER non-SHF_GROUP C identifier name sections`.

In D96914#2576040 <https://reviews.llvm.org/D96914#2576040>, @jrtc27 wrote:

> FreeBSD uses linker sets extensively. Do not remove this, you will break FreeBSD, both the kernel and userspace.

I think I'd like bjk's word: "'that breaks linker sets entirely' seems like something that would benefit from a paragraph or two of additional exposition". Perhaps @dim can help on discussing this on a FreeBSD mailing list (I don't subscribe them).

In D96914#2578466 <https://reviews.llvm.org/D96914#2578466>, @theraven wrote:

> Please can you ensure that this is tested with some Objective-C code compiled with `-fobjc-runtime=gnustep-2.0`?  If I am reading the intention correctly, it may result in all of the Objective-C code being dropped from the final link.

I know almost nothing about Objective-C. Can you name the section which could be problematic?

  % clang -ffunction-sections -fobjc-runtime=gnustep-2.0 -isystem /usr/include/GNUstep a.m
  In file included from a.m:1:
  /usr/include/GNUstep/Foundation/Foundation.h:31:9: fatal error: 'objc/objc.h' file not found
  #import <objc/objc.h>
          ^~~~~~~~~~~~~
  1 error generated.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96914



More information about the llvm-commits mailing list