Copy relocation on a non-default version symbol is unsupported and can crash at runtime. Fortunately there is a one-line fix which works for most cases: ensure `getSymbolsAt` unconditionally returns `ss`. If two non-default version symbols are defined at the same place and both are copy relocated, our implementation will copy relocated them into different addresses. The pointer inequality is very unlikely an issue. In GNU ld, copy relocating version aliases seems to create more pointer inequality problems than us. ( In glibc, sys_errlist@GLIBC_2.2.5 sys_errlist@GLIBC_2.3 sys_errlist@GLIBC_2.4 are defined at the same place, but it is unlikely they are all copy relocated in one executable. Even if so, the variables are read-only and pointer inequality should not be a problem. ) Reviewed By: peter.smith Differential Revision: https://reviews.llvm.org/D107535
23 lines
286 B
ArmAsm
23 lines
286 B
ArmAsm
.data
|
|
.global foo_v1
|
|
.symver foo_v1, foo@v1, remove
|
|
.type foo_v1, @object
|
|
.size foo_v1, 4
|
|
|
|
.global foo_v2
|
|
.symver foo_v2, foo@v2, remove
|
|
.type foo_v2, @object
|
|
.size foo_v2, 8
|
|
|
|
.global foo
|
|
.symver foo, foo@@@v3
|
|
.type foo, @object
|
|
.size foo, 12
|
|
|
|
foo_v1:
|
|
foo_v2:
|
|
foo:
|
|
.int 0
|
|
.int 0
|
|
.int 0
|