From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/9510 Path: news.gmane.org!not-for-mail From: "Rich Felker (dalias@libc.org)" Newsgroups: gmane.linux.lib.musl.general Subject: Re: MUSL MIPS64 N64 port Date: Sun, 6 Mar 2016 12:17:11 -0500 Message-ID: <20160306171711.GT9349@brightrain.aerifal.cx> References: <20160301023523.GG9349@brightrain.aerifal.cx> <20160302044143.GM9349@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1457284662 18206 80.91.229.3 (6 Mar 2016 17:17:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 6 Mar 2016 17:17:42 +0000 (UTC) Cc: Mahesh Bodapati , "musl@lists.openwall.com" , "nsz@port70.net" To: Jaydeep Patil Original-X-From: musl-return-9523-gllmg-musl=m.gmane.org@lists.openwall.com Sun Mar 06 18:17:38 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1accJG-0005sk-2f for gllmg-musl@m.gmane.org; Sun, 06 Mar 2016 18:17:38 +0100 Original-Received: (qmail 22369 invoked by uid 550); 6 Mar 2016 17:17:35 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 22340 invoked from network); 6 Mar 2016 17:17:33 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:9510 Archived-At: On Wed, Mar 02, 2016 at 05:50:41AM +0000, Jaydeep Patil wrote: > +typedef struct { > + gregset_t gregs; > + fpregset_t fpregs; > + greg_t mdhi; > + greg_t hi1; > + greg_t hi2; > + greg_t hi3; > + greg_t mdlo; > + greg_t lo1; > + greg_t lo2; > + greg_t lo3; > + greg_t pc; > + unsigned int fpc_csr; > + unsigned int used_math; > + unsigned int dsp; > + unsigned int reserved; > +} mcontext_t; > + > +#else > +typedef struct { > + unsigned __mc1[2]; > + unsigned long long __mc2[65]; > + unsigned __mc3[5]; > + unsigned long long __mc4[2]; > + unsigned __mc5[6]; > +} mcontext_t; > +#endif I found one more bug -- this second definition of mcontext_t needs to match the real version in size and alignment, but be namespace-safe. As-is it's just copied from o32. I'll fix it when committing though; the fix is trivial. > diff --git a/ldso/dynlink.c b/ldso/dynlink.c > index 87f3b7f..e458f38 100644 > --- a/ldso/dynlink.c > +++ b/ldso/dynlink.c > @@ -1134,7 +1134,7 @@ static void do_mips_relocs(struct dso *p, size_t *got) > Sym *sym = p->syms + j; > rel[0] = (unsigned char *)got - base; > for (i-=j; i; i--, sym++, rel[0]+=sizeof(size_t)) { > - rel[1] = sym-p->syms << 8 | R_MIPS_JUMP_SLOT; > + rel[1] = R_INFO(sym-p->syms, R_MIPS_JUMP_SLOT); > do_relocs(p, rel, sizeof rel, 2); > } > } > [...] > diff --git a/src/internal/dynlink.h b/src/internal/dynlink.h > index 48890b2..5717627 100644 > --- a/src/internal/dynlink.h > +++ b/src/internal/dynlink.h > @@ -11,12 +11,14 @@ typedef Elf32_Phdr Phdr; > typedef Elf32_Sym Sym; > #define R_TYPE(x) ((x)&255) > #define R_SYM(x) ((x)>>8) > +#define R_INFO ELF32_R_INFO > #else > typedef Elf64_Ehdr Ehdr; > typedef Elf64_Phdr Phdr; > typedef Elf64_Sym Sym; > #define R_TYPE(x) ((x)&0x7fffffff) > #define R_SYM(x) ((x)>>32) > +#define R_INFO ELF64_R_INFO > #endif I'm going to commit these two changes first as their own patch because they're the only ones that touch files outside the mips64 port. Then the mips64 commit will be purely adding new files and not modifying any existing code. I didn't find anything else that looks like a blocker; if other issues come up we can simply commit fixes. Going ahead and getting the port committed should help get some more testing done before the next release so we can have it well-tested by then. Thanks for all your work on this! Rich