mailing list of musl libc
 help / color / mirror / code / Atom feed
From: "Rich Felker (dalias@libc.org)" <dalias@libc.org>
To: Jaydeep Patil <Jaydeep.Patil@imgtec.com>
Cc: Mahesh Bodapati <Mahesh.Bodapati@imgtec.com>,
	"musl@lists.openwall.com" <musl@lists.openwall.com>,
	"nsz@port70.net" <nsz@port70.net>
Subject: Re: MUSL MIPS64 N64 port
Date: Sun, 6 Mar 2016 12:17:11 -0500	[thread overview]
Message-ID: <20160306171711.GT9349@brightrain.aerifal.cx> (raw)
In-Reply-To: <BD7773622145634B952E5B54ACA8E349AA244CBC@PUMAIL01.pu.imgtec.org>

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


      reply	other threads:[~2016-03-06 17:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-26  7:13 Jaydeep Patil
2016-03-01  0:11 ` Rich Felker (dalias@libc.org)
2016-03-01  2:35 ` Rich Felker (dalias@libc.org)
2016-03-01  7:52   ` Jaydeep Patil
2016-03-02  4:41     ` Rich Felker (dalias@libc.org)
2016-03-02  5:50       ` Jaydeep Patil
2016-03-06 17:17         ` Rich Felker (dalias@libc.org) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160306171711.GT9349@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=Jaydeep.Patil@imgtec.com \
    --cc=Mahesh.Bodapati@imgtec.com \
    --cc=musl@lists.openwall.com \
    --cc=nsz@port70.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).