[PATCH] D21781: [ELF] Warn for duplicate symbols in version scripts instead of erroring out

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 28 13:45:06 PDT 2016


On Tue, Jun 28, 2016 at 5:30 AM, Rafael EspĂ­ndola
<llvm-commits at lists.llvm.org> wrote:
> I really think this should be an error. If we need a hack for now it
> should be warning, but we should have an open bug on making this an
> error again.
>
> Both gold and bfd put the symbol just in the first version. We put it
> just in the last version. Both are really confusing.
>
> I will open a bug on making this a error again.
>

I share your feelings, Rafael, at least partly. I always try to err on
the side of safety (which in this case would mean emitting an error).
In this case tho, I'm not entirely sure it's an option. I may miss
something, so, here's my question: how do you plan to deal with
downstream consumers? I agree people abused of this feature because in
the past there was no error handling/checking. But this is the world
we (have to) live in, and it's (IMHO) not entirely reasonable asking
people to change their version scripts which before worked just fine.
With all the coverage we can get, there's gonna still be a lot of
people we'll never know of which will be sad because their code won't
link, and they'll either complain or switch back to something else.
So, after my $0.02, the best I'm able to propose is introducing a knob
(e.g. --allows-multiple-in-version-script, or maybe something less
verbose), defaulted to true to preserve compatibility with
ld.{bfd,gold}, and *eventually* try to switch that on by default.

Hope this makes sense to you. If not, happy to hear what's your plan =)

--
Davide


More information about the llvm-commits mailing list