echristo added a comment.

There are two things pushing and pulling here:

a) You want to be able to pass compiler code generation options at the time 
we're actually doing the code generation,
b) "Traditionally" we don't pass CFLAGS to the linker.

I think I'd like to see us passing more options down at code generation time 
and handling it explicitly. In particular for this we don't have the knowledge 
at link time of what was intended. Even if we only turn it on when we see 
-gc-sections we won't know if the programmer wants function and data sections 
or just the former. Or maybe they want function sections for some reason other 
than gc-sections.

In short, I'm more on the a) side here in what I want :)

To go to PR22999: I think it might be reasonable for the linker during code 
generation to turn on function/data-sections where it isn't reasonable for us 
to do so in the compiler. I can come up with weird cases to break it, but those 
are largely module level inline assembly.


https://reviews.llvm.org/D24644



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to