From: nagarathnam muthusamy <nagarathnam.muthusamy@oracle.com>
To: sparclinux@vger.kernel.org
Subject: Re: [PATCH V3] vDSO for SPARC
Date: Thu, 21 Sep 2017 15:12:02 +0000 [thread overview]
Message-ID: <59C3D6C2.7030805@oracle.com> (raw)
In-Reply-To: <1502400887-281290-1-git-send-email-nagarathnam.muthusamy@oracle.com>
Hi David,
I have fixed the issues with the patch and sent an updated patch. I
was able to reproduce the issue
in a qemu sparc emulator running Debian. I checked that the VDSO
binaries pass compilation with the
new patch in that environment.
Thanks,
Nagarathnam.
On 9/10/2017 9:03 PM, David Miller wrote:
> From: David Miller <davem@davemloft.net>
> Date: Sat, 09 Sep 2017 20:41:29 -0700 (PDT)
>
>> The arch/sparc/vdso/vdso.lds file says:
>>
>> vvar_start = . -(1 << 12);
>>
>> And "1 << 12" is 4096, therefore a multiple of 4096 and not 8192.
>>
>> So, as requested, the object built gets:
>>
>> davem@patience:~/src/GIT/sparc-next$ nm -n arch/sparc/vdso/vdso64.so.dbg
>> fffffffffffff000 a vvar_data
>> fffffffffffff000 a vvar_start
> Breaking this down further, the linker scripts are written assuming
> they will be built by a host compiler that generates 64-bit target
> code by default.
>
> This is not a safe assumption.
>
> My system generates 32-bit binaries from gcc by default, and that's
> why you end up with a value of PAGE_SIZE which is 4096 propagating
> through all of the generated linker scripts.
>
> x86, where it seems like were at least used as a template for the
> sparc linker scripts, gets away with this because the PAGE_SIZE
> is the same on 32-bit and 64-bit.
>
> Anyways, since 8192 is hard coded into vdso2c, just use 8192 as
> PAGE_SIZE in vdso-layout.lds.S and maybe put a comment above it.
>
> The next problem with the patch is that we get a warning because
> the variable 'secstrings_hdr' is set but not used in vdso2c.h, and
> compiler warnings are treated as errors under arch/sparc.
>
> This is fixed simply by:
>
> diff --git a/arch/sparc/vdso/vdso2c.h b/arch/sparc/vdso/vdso2c.h
> index 8d1b5cf..b193e3d 100644
> --- a/arch/sparc/vdso/vdso2c.h
> +++ b/arch/sparc/vdso/vdso2c.h
> @@ -17,9 +17,8 @@ static void BITSFUNC(go)(void *raw_addr, size_t raw_len,
> unsigned long mapping_size;
> int i;
> unsigned long j;
> - const char *secstrings;
>
> - ELF(Shdr) *symtab_hdr = NULL, *strtab_hdr, *secstrings_hdr;
> + ELF(Shdr) *symtab_hdr = NULL, *strtab_hdr;
> ELF(Ehdr) *hdr = (ELF(Ehdr) *)raw_addr;
> ELF(Dyn) *dyn = 0, *dyn_end = 0;
> INT_BITS syms[NSYMS] = {};
> @@ -64,9 +63,6 @@ static void BITSFUNC(go)(void *raw_addr, size_t raw_len,
> }
>
> /* Walk the section table */
> - secstrings_hdr = raw_addr + GET_BE(&hdr->e_shoff) +
> - GET_BE(&hdr->e_shentsize)*GET_BE(&hdr->e_shstrndx);
> - secstrings = raw_addr + GET_BE(&secstrings_hdr->sh_offset);
> for (i = 0; i < GET_BE(&hdr->e_shnum); i++) {
> ELF(Shdr) *sh = raw_addr + GET_BE(&hdr->e_shoff) +
> GET_BE(&hdr->e_shentsize) * i;
prev parent reply other threads:[~2017-09-21 15:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-10 21:34 [PATCH V3] vDSO for SPARC Nagarathnam Muthusamy
2017-08-10 22:03 ` David Miller
2017-08-10 23:13 ` Nagarathnam Muthusamy
2017-08-11 12:23 ` Nick Alcock
2017-08-15 5:35 ` David Miller
2017-09-10 3:41 ` David Miller
2017-09-11 4:03 ` David Miller
2017-09-11 14:34 ` Nick Alcock
2017-09-21 15:12 ` nagarathnam muthusamy [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=59C3D6C2.7030805@oracle.com \
--to=nagarathnam.muthusamy@oracle.com \
--cc=sparclinux@vger.kernel.org \
/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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.