Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Sun, 6 Mar 2016 12:17:11 -0500
From: "Rich Felker (dalias@...c.org)" <dalias@...c.org>
To: Jaydeep Patil <Jaydeep.Patil@...tec.com>
Cc: Mahesh Bodapati <Mahesh.Bodapati@...tec.com>,
	"musl@...ts.openwall.com" <musl@...ts.openwall.com>,
	"nsz@...t70.net" <nsz@...t70.net>
Subject: Re: MUSL MIPS64 N64 port

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

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.