On Wed, Aug 31, 2016 at 5:33 PM, Nadav Har'El <[email protected]> wrote:
> I'm more worried about the symbol(sym) part of this code... What if there
> is no symbol involved? In this case (again see readelf --relocs for your
> object), there is no object...
>
> I think the code involved is the one added in commit
> b9b73661543e614c7dfb3616bd3a75acfa30911e:
>
> x64: Fix R_X86_64_TPOFF64 relocation without symbol
>
> Maybe this code (the no-symbol case) has a bug?
>
>
This actually eveloved quite a bit since that patch. It now looks like:
case R_X86_64_TPOFF64:
if (sym) {
auto sm = symbol(sym);
sm.obj->alloc_static_tls();
auto tls_offset = sm.obj->static_tls_end() +
sched::kernel_tls_size();
*static_cast<u64*>(addr) = sm.symbol->st_value + addend -
tls_offset;
} else {
alloc_static_tls();
auto tls_offset = static_tls_end() + sched::kernel_tls_size();
*static_cast<u64*>(addr) = addend - tls_offset;
}
This was written in commit 8e99d1537dc753410cca0197528118ed370ad589
specificially about support initial-exec tls model.
But maybe has a bug?
--
You received this message because you are subscribed to the Google Groups "OSv
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.