mailing list of musl libc
 help / color / mirror / code / Atom feed
* MIPS-specific regression in musl 1.1.3
@ 2014-06-30  6:36 Rich Felker
  0 siblings, 0 replies; only message in thread
From: Rich Felker @ 2014-06-30  6:36 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 405 bytes --]

Changes to the dynamic linker made between the 1.1.2 and 1.1.3
releases or musl broke non-trivial relocation processing on MIPS. This
issue is fixed in commit 2d8cc92a7cb4a3256ed07d86843388ffd8a882b1.
Anyone wishing to use 1.1.3 on MIPS should apply the attached patch.
The gorey details are in the commit log:

http://git.musl-libc.org/cgit/musl/commit/?id=2d8cc92a7cb4a3256ed07d86843388ffd8a882b1

Rich

[-- Attachment #2: mipsfix.diff --]
[-- Type: text/plain, Size: 1257 bytes --]

diff --git a/arch/mips/reloc.h b/arch/mips/reloc.h
index 91fa097..4b81d32 100644
--- a/arch/mips/reloc.h
+++ b/arch/mips/reloc.h
@@ -86,3 +86,4 @@ static void do_arch_relocs(struct dso *this, struct dso *head)
 
 #define NEED_ARCH_RELOCS 1
 #define DYNAMIC_IS_RO 1
+#define ARCH_SYM_REJECT_UND(s) (!((s)->st_other & STO_MIPS_PLT))
diff --git a/src/ldso/dynlink.c b/src/ldso/dynlink.c
index a08300d..55124ff 100644
--- a/src/ldso/dynlink.c
+++ b/src/ldso/dynlink.c
@@ -233,6 +233,10 @@ static Sym *gnu_lookup(const char *s, uint32_t h1, struct dso *dso)
 #define OK_TYPES (1<<STT_NOTYPE | 1<<STT_OBJECT | 1<<STT_FUNC | 1<<STT_COMMON | 1<<STT_TLS)
 #define OK_BINDS (1<<STB_GLOBAL | 1<<STB_WEAK | 1<<STB_GNU_UNIQUE)
 
+#ifndef ARCH_SYM_REJECT_UND
+#define ARCH_SYM_REJECT_UND(s) 0
+#endif
+
 static struct symdef find_sym(struct dso *dso, const char *s, int need_def)
 {
 	uint32_t h = 0, gh = 0;
@@ -249,7 +253,8 @@ static struct symdef find_sym(struct dso *dso, const char *s, int need_def)
 		}
 		if (!sym) continue;
 		if (!sym->st_shndx)
-			if (need_def || (sym->st_info&0xf) == STT_TLS)
+			if (need_def || (sym->st_info&0xf) == STT_TLS
+			    || ARCH_SYM_REJECT_UND(sym))
 				continue;
 		if (!sym->st_value)
 			if ((sym->st_info&0xf) != STT_TLS)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-06-30  6:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-30  6:36 MIPS-specific regression in musl 1.1.3 Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).