From 650f4477a5b66368a660f22e651b389500d9f87a Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Fri, 29 Mar 2019 15:07:00 +0000 Subject: [PATCH] rtld: attempt to fix reloc_non_plt TLS allocation on MIPS allocate_tls_offset returns true on success. The same issue existed on arm and was fixed in r345693. PR: 236880 MFC after: 1 month Sponsored by: The FreeBSD Foundation --- libexec/rtld-elf/mips/reloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libexec/rtld-elf/mips/reloc.c b/libexec/rtld-elf/mips/reloc.c index 129a62592d1a..8bc3e95cb4d3 100644 --- a/libexec/rtld-elf/mips/reloc.c +++ b/libexec/rtld-elf/mips/reloc.c @@ -588,7 +588,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, if (def == NULL) return -1; - if (!defobj->tls_done && allocate_tls_offset(obj)) + if (!defobj->tls_done && !allocate_tls_offset(obj)) return -1; val += (Elf_Addr)def->st_value - TLS_DTP_OFFSET; @@ -616,7 +616,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, if (def == NULL) return -1; - if (!defobj->tls_done && allocate_tls_offset(obj)) + if (!defobj->tls_done && !allocate_tls_offset(obj)) return -1; val += (Elf_Addr)(def->st_value + defobj->tlsoffset