[PATCH] D24229: [ELF] - Versionscript: do not treat non-wildcarded names as wildcards.
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 7 02:16:05 PDT 2016
grimar added a comment.
In https://reviews.llvm.org/D24229#535364, @ruiu wrote:
> With this patch, the existence of double quotes affects how strings will be interpreted later. Such grammar seems really weird to me. Are you sure that the grammar is correct?
Yes, I believe so. From GNU Liner specs
(p.66 https://web.eecs.umich.edu/~prabal/teaching/resources/eecs373/Linker.pdf):
"Demangled names may contains spaces and other special characters. As described above,
you can use a glob pattern to match demangled names, or you can use a double-quoted
string to match the string exactly. In the latter case, be aware that minor differences (such
as differing whitespace) between the version script and the demangler output will cause a
mismatch."
Behavior is expected, I re-checked both gold and ld:
Used version script:
LIBSAMPLE_1.0 {
global:
extern "C++" {
"foo*";
};
};
Code:
.text
.globl _Z3fooi
.type _Z3fooi, at function
_Z3fooi:
retq
llvm-mc -filetype=obj -triple=x86_64-pc-linux test1.s -o test1.o
ld --version-script test.script -shared test1.o -o out
llvm-readobj -V out
foo is unversioned:
Symbol {
Version: 1
Name: _Z3fooi@
}
But if I remove quotes then it has version LIBSAMPLE_1.0:
LIBSAMPLE_1.0 {
global:
extern "C++" {
foo*;
};
};
Symbol {
Version: 2
Name: _Z3fooi@@LIBSAMPLE_1.0
}
That actually looks as simple and nice rule for me. Value in quotes is always exact match only and never a wildcard.
https://reviews.llvm.org/D24229
More information about the llvm-commits
mailing list