rtld: attempt to fix reloc_nonplt_object TLS allocation

allocate_tls_offset returns true on success.  This still needs more
testing and review, but this change is consistent with other archs.

PR:		236880
Reported by:	Andrew Gierth <andrew@tao11.riddles.org.uk>
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Ed Maste 2019-03-29 14:35:23 +00:00
parent f220ef0b35
commit dc412d2d4b

View File

@ -319,7 +319,7 @@ reloc_nonplt_object(Obj_Entry *obj, const Elf_Rel *rel, SymCache *cache,
if (def == NULL)
return -1;
if (!defobj->tls_done && allocate_tls_offset(obj))
if (!defobj->tls_done && !allocate_tls_offset(obj))
return -1;
tmp = (Elf_Addr)def->st_value + defobj->tlsoffset;