Details
- Reviewers
ruiu • rafael grimar - Commits
- rG4fdc6485923c: [ELF] Warn for duplicate symbols in version scripts instead of erroring out.
rLLD273989: [ELF] Warn for duplicate symbols in version scripts instead of erroring out.
rL273989: [ELF] Warn for duplicate symbols in version scripts instead of erroring out.
Diff Detail
- Repository
- rL LLVM
Event Timeline
See my comment on http://reviews.llvm.org/D21555 for the rationale behind this change.
I am not sure we should. That is definitely a error in script to have that. Users should fix their scripts instead.
Well, listing the same symbol under one version does not seem to be a error for me,
but listing the same symbol under different versions at least worth a warning as
it is possible that linker override one and that is confusing.
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.
Cheers,
Rafael
I definitely don't want to see the warning removed altogether (and have a slight preference for seeing this become an error again eventually).
FreeBSD's libcxxrt version map has had a copy-and-paste error for 2.5 years (since it was introduced) resulting in missing exported symbols: it had duplicated _ZTIPDn entries, instead of _ZTIPDn and _ZTSPDn. The mistake went unnoticed until I tried building with lld and encountered the duplicate symbol error from lld. So I think this warning / error is not spurious and will catch real mistakes that need to be fixed in version scripts.
I agree with Rafael that it should be an error. There is one situation that we want to handle smarter, but that's it. If the version is the result from an explicit match and a wildcard, the explicit match should win and the wildcard be ignored. But that's the only exception I can sanely see.
And if there is more than 1 match using wildcard, the last matching version tag in the file should be used.
(http://www.airs.com/blog/archives/300).