MaskRay added a comment.
The inconsistency stem from the fact that with the default `.text`, the
compiler may generate `.text.$suffix` if `-ffunction-sections` is specified or
if a COMDAT is needed.
While with an explicit section, there is no such suffix appending mechanism
used together with `
probinson abandoned this revision.
probinson added a comment.
I think the GC behavior with explicit section names is currently a little
peculiar. For functions without a section name, -ffunction-sections allows GC
to happen at the individual function level. With a section name, GC would
happen
MaskRay added a comment.
> the programmer is indicating the function has some special purpose, and is
> not expected to be garbage collected.
There are use cases that GC semantics are desired. They may place the address
function in a variable.
I don't think changing the behavior by default is f
probinson created this revision.
probinson added a reviewer: MaskRay.
Herald added a project: All.
probinson requested review of this revision.
People use -ffunction-sections to put each function into its own
object-file section; this makes linker garbage-collection simpler.
However, if there's an