On Tue, 26 Mar 2013 23:05:05 +0100 (CET), Mark Kettenis wrote: > > Date: Tue, 26 Mar 2013 23:54:20 +0200 > > From: Paul Irofti <p...@irofti.net> > > I don't understand how, can you go into more details please? > > > > Anyway, can we then just ignore the -pg option if it doesn't work for > > shared instead of breaking the link? Or do you have a better solution? > > Perhaps ld shouldn't set link_info.shared to FALSE when it sees -nopie?
At the ld level, it basically breaks down to the question what the desired behaviour is when nonsensical combinations of -nopie and -shared are encountered. At the moment, -nopie cancels out a previously encountered -shared, so ld -shared -nopie ... will try to generate a non-shared, non-pie object, while ld -nopie -shared ... will behave the same as "ld -shared". I think this is the behaviour most people would expect, but I might be wrong. Other opinions?