public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>,
	GNU C Library <libc-alpha@sourceware.org>,
		Binutils <binutils@sourceware.org>
Subject: Re: RFC: PATCHES: Properly handle reference to protected data on x86
Date: Fri, 06 Mar 2015 22:54:00 -0000	[thread overview]
Message-ID: <CAMe9rOpYND1Jt31Hk-KRRG3iTQQuLapgCLyC_=W51fEtz0N_eA@mail.gmail.com> (raw)
In-Reply-To: <CAMe9rOr3ScyMRZwEkdOtOWV7Y+3Aj-e2GtU7Rnba64rr6kgA8Q@mail.gmail.com>

On Thu, Mar 5, 2015 at 6:39 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Wed, Mar 4, 2015 at 3:26 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> Protected symbol means that it can't be pre-emptied.  It
>> doesn't mean its address won't be external.  This is true
>> for pointer to protected function.  With copy relocation,
>> address of protected data defined in the shared library may
>> also be external.  We only know that for sure at run-time.
>> Here are patches for glibc, binutils and GCC to handle it
>> properly.
>>
>> Any comments?
>
> This is the binutils patch I checked in.  It basically reverted
> the change for
>
> https://sourceware.org/bugzilla/show_bug.cgi?id=15228
>
> on x86.  Copy relocations against protected symbols should
> work.
>
> --
> H.J.
> ---
> bfd/
>
> PR ld/pr15228
> PR ld/pr17709
> * elf-bfd.h (elf_backend_data): Add extern_protected_data.
> * elf32-i386.c (elf_backend_extern_protected_data): New.
> Defined to 1.
> * elf64-x86-64.c (elf_backend_extern_protected_data): Likewise.
> * elflink.c (_bfd_elf_adjust_dynamic_copy): Don't error on
> copy relocs against protected symbols if extern_protected_data
> is true.
> (_bfd_elf_symbol_refs_local_p): Don't return true on protected
> non-function symbols if extern_protected_data is true.
> * elfxx-target.h (elf_backend_extern_protected_data): New.
> Default to 0.
> (elfNN_bed): Initialize extern_protected_data with
> elf_backend_extern_protected_data.
>
> ld/testsuite/
>
> PR ld/pr15228
> PR ld/pr17709
> * ld-i386/i386.exp (i386tests): Add a test for PR ld/17709.
> * ld-i386/pr17709-nacl.rd: New file.
> * ld-i386/pr17709.rd: Likewise.
> * ld-i386/pr17709a.s: Likewise.
> * ld-i386/pr17709b.s: Likewise.
> * ld-i386/protected3.d: Updated.
> * ld-i386/protected3.s: Likewise.
> * ld-x86-64/pr17709-nacl.rd: New file.
> * ld-x86-64/pr17709.rd: Likewise.
> * ld-x86-64/pr17709a.s: Likewise.
> * ld-x86-64/pr17709b.s: Likewise.
> * ld-x86-64/protected3.d: Updated.
> * ld-x86-64/protected3.s: Likewise.
> * ld-x86-64/x86-64.exp (x86_64tests): Add a test for PR ld/17709.

I back ported it to 2.25 branch.

-- 
H.J.

  parent reply	other threads:[~2015-03-06 22:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-05 14:39 H.J. Lu
2015-03-05 17:33 ` Rich Felker
2015-03-05 17:56   ` H.J. Lu
2015-03-06 22:54 ` H.J. Lu [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-03-04 23:26 H.J. Lu
2015-03-06  4:19 ` Alan Modra
2015-03-06 13:05   ` H.J. Lu
2015-03-07  0:15     ` Alan Modra
2015-03-07  1:03       ` H.J. Lu
2015-03-07 12:01         ` Alan Modra
2015-03-07 12:51           ` H.J. Lu
2015-03-06 11:01 ` Szabolcs Nagy
2015-03-06 18:29 ` Joseph Myers
2015-03-06 18:33   ` H.J. Lu

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='CAMe9rOpYND1Jt31Hk-KRRG3iTQQuLapgCLyC_=W51fEtz0N_eA@mail.gmail.com' \
    --to=hjl.tools@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libc-alpha@sourceware.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 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 read-only IMAP folder(s) and NNTP newsgroup(s).