[patch ob] Disallow -pie and -static

Cary Coutant ccoutant@google.com
Mon Feb 27 23:59:00 GMT 2012


> i'm not arguing that things will work today ... we all agree on that.  my
> point was that the commit was light on details, and for pedants, not an
> entirely accurate error message.
>
> i don't think my implied question was answered: what was the reason for the
> internal error that gold was throwing ?  it just didn't know what to do when
> give -pie -static ?  or there was misbehavior with incoming objects that only
> occurred when using -pie -static ?

Gold was actually about to print an error message that -static was
used on a non-static link, and was trying to print the name of the
first dynamic object that caused the linker to believe it was not a
static link. There's an assert that there is at least one dynamic
object in that case, but the non-static link was caused by the use of
-pie, and there were no dynamic objects. The same thing would have
happened with -shared and -static, but that combination of options was
already excluded (in the same place where I added the exclusion of
-pie and -static). My patch was just to catch the conflict earlier
where it can be handled gracefully, rather than later, where it is
more awkward to handle.

-cary



More information about the Binutils mailing list