public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work
@ 2014-12-14 12:43 hjl.tools at gmail dot com
  2014-12-14 15:05 ` Ondřej Bílka
                   ` (31 more replies)
  0 siblings, 32 replies; 33+ messages in thread
From: hjl.tools at gmail dot com @ 2014-12-14 12:43 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17711

            Bug ID: 17711
           Summary: copy relocations against protected symbols don't work
           Product: glibc
           Version: 2.21
            Status: NEW
          Severity: normal
          Priority: P2
         Component: dynamic-link
          Assignee: unassigned at sourceware dot org
          Reporter: hjl.tools at gmail dot com

On Linux/x86-64, I got

[hjl@gnu-tools-1 pr15228]$ cat x.c 
extern int a;

extern void bar (void);

int main()
{
  bar ();
  if (a != 30)
    __builtin_abort();
  return 0;
}
[hjl@gnu-tools-1 pr15228]$ cat bar.c 
int a;

__attribute__((visibility("protected"))) int a;

void
bar ()
{
  a = 30;
}
[hjl@gnu-tools-1 pr15228]$ make all
gcc  -B/bin/    -c -o x.o x.c
gcc  -B/bin/ -fPIC   -c -o bar.o bar.c
./ld -shared -o libbar.so bar.o
gcc  -B/bin/  -o x x.o libbar.so -Wl,-rpath,.
./x
make: *** [all] Aborted (core dumped)
[hjl@gnu-tools-1 pr15228]$ 

Should it be disallowed by linker?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work
  2014-12-14 12:43 [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work hjl.tools at gmail dot com
@ 2014-12-14 15:05 ` Ondřej Bílka
  2014-12-14 15:06 ` [Bug dynamic-link/17711] " neleai at seznam dot cz
                   ` (30 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: Ondřej Bílka @ 2014-12-14 15:05 UTC (permalink / raw)
  To: hjl.tools at gmail dot com; +Cc: glibc-bugs

On Sun, Dec 14, 2014 at 12:43:50PM +0000, hjl.tools at gmail dot com wrote:
> https://sourceware.org/bugzilla/show_bug.cgi?id=17711
> 
>             Bug ID: 17711
>            Summary: copy relocations against protected symbols don't work
>            Product: glibc
>            Version: 2.21
>             Status: NEW
>           Severity: normal
>           Priority: P2
>          Component: dynamic-link
>           Assignee: unassigned at sourceware dot org
>           Reporter: hjl.tools at gmail dot com
> 
> On Linux/x86-64, I got
> 
> [hjl@gnu-tools-1 pr15228]$ cat x.c 
> extern int a;
> 
> extern void bar (void);
> 
> int main()
> {
>   bar ();
>   if (a != 30)
>     __builtin_abort();
>   return 0;
> }
> [hjl@gnu-tools-1 pr15228]$ cat bar.c 
> int a;
> 
> __attribute__((visibility("protected"))) int a;
> 
> void
> bar ()
> {
>   a = 30;
> }
> [hjl@gnu-tools-1 pr15228]$ make all
> gcc  -B/bin/    -c -o x.o x.c
> gcc  -B/bin/ -fPIC   -c -o bar.o bar.c
> ./ld -shared -o libbar.so bar.o
> gcc  -B/bin/  -o x x.o libbar.so -Wl,-rpath,.
> ./x
> make: *** [all] Aborted (core dumped)
> [hjl@gnu-tools-1 pr15228]$ 
> 
What commit does git bisect report?


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug dynamic-link/17711] copy relocations against protected symbols don't work
  2014-12-14 12:43 [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work hjl.tools at gmail dot com
  2014-12-14 15:05 ` Ondřej Bílka
@ 2014-12-14 15:06 ` neleai at seznam dot cz
  2014-12-14 15:14 ` hjl.tools at gmail dot com
                   ` (29 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: neleai at seznam dot cz @ 2014-12-14 15:06 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17711

--- Comment #1 from Ondrej Bilka <neleai at seznam dot cz> ---
On Sun, Dec 14, 2014 at 12:43:50PM +0000, hjl.tools at gmail dot com wrote:
> https://sourceware.org/bugzilla/show_bug.cgi?id=17711
> 
>             Bug ID: 17711
>            Summary: copy relocations against protected symbols don't work
>            Product: glibc
>            Version: 2.21
>             Status: NEW
>           Severity: normal
>           Priority: P2
>          Component: dynamic-link
>           Assignee: unassigned at sourceware dot org
>           Reporter: hjl.tools at gmail dot com
> 
> On Linux/x86-64, I got
> 
> [hjl@gnu-tools-1 pr15228]$ cat x.c 
> extern int a;
> 
> extern void bar (void);
> 
> int main()
> {
>   bar ();
>   if (a != 30)
>     __builtin_abort();
>   return 0;
> }
> [hjl@gnu-tools-1 pr15228]$ cat bar.c 
> int a;
> 
> __attribute__((visibility("protected"))) int a;
> 
> void
> bar ()
> {
>   a = 30;
> }
> [hjl@gnu-tools-1 pr15228]$ make all
> gcc  -B/bin/    -c -o x.o x.c
> gcc  -B/bin/ -fPIC   -c -o bar.o bar.c
> ./ld -shared -o libbar.so bar.o
> gcc  -B/bin/  -o x x.o libbar.so -Wl,-rpath,.
> ./x
> make: *** [all] Aborted (core dumped)
> [hjl@gnu-tools-1 pr15228]$ 
> 
What commit does git bisect report?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug dynamic-link/17711] copy relocations against protected symbols don't work
  2014-12-14 12:43 [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work hjl.tools at gmail dot com
  2014-12-14 15:05 ` Ondřej Bílka
  2014-12-14 15:06 ` [Bug dynamic-link/17711] " neleai at seznam dot cz
@ 2014-12-14 15:14 ` hjl.tools at gmail dot com
  2014-12-14 20:24 ` hjl.tools at gmail dot com
                   ` (28 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: hjl.tools at gmail dot com @ 2014-12-14 15:14 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17711

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Ondrej Bilka from comment #1)
> What commit does git bisect report?

I don't think it ever worked.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug dynamic-link/17711] copy relocations against protected symbols don't work
  2014-12-14 12:43 [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work hjl.tools at gmail dot com
                   ` (2 preceding siblings ...)
  2014-12-14 15:14 ` hjl.tools at gmail dot com
@ 2014-12-14 20:24 ` hjl.tools at gmail dot com
  2014-12-15  0:58 ` hjl.tools at gmail dot com
                   ` (27 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: hjl.tools at gmail dot com @ 2014-12-14 20:24 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17711

--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
Ld doesn't set it up properly for ld.so to handle it.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug dynamic-link/17711] copy relocations against protected symbols don't work
  2014-12-14 12:43 [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work hjl.tools at gmail dot com
                   ` (3 preceding siblings ...)
  2014-12-14 20:24 ` hjl.tools at gmail dot com
@ 2014-12-15  0:58 ` hjl.tools at gmail dot com
  2014-12-17 16:27 ` hjl.tools at gmail dot com
                   ` (26 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: hjl.tools at gmail dot com @ 2014-12-15  0:58 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17711

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |17709

--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> ---
It is related to PR ld/17709.  I think protected data symbol is totally
broken on targets with copy relocation for both ld and ld.so.  We should
either disallow protected data symbol or make it to work with copy relocation.
Otherwise, we can't update a DSO which has a normal data, FOO, to a DSO
which has a protected data, FOO.  The main problem is when building a DSO
with a protected data, FOO, we don't know if FOO will be accessed via copy
relocation or not.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug dynamic-link/17711] copy relocations against protected symbols don't work
  2014-12-14 12:43 [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work hjl.tools at gmail dot com
                   ` (4 preceding siblings ...)
  2014-12-15  0:58 ` hjl.tools at gmail dot com
@ 2014-12-17 16:27 ` hjl.tools at gmail dot com
  2014-12-17 21:25 ` hjl.tools at gmail dot com
                   ` (25 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: hjl.tools at gmail dot com @ 2014-12-17 16:27 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17711

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |2.21

--- Comment #5 from H.J. Lu <hjl.tools at gmail dot com> ---
To properly support protected data in a DSO with copy relocation,
we need to keep track if a symbol has been copy relocated. We can
add an array of DSOes indexed with symbol index to record the
original DSOs for copy relocation.  This array will be created only
for DSOs with protected data on targets with copy relocation.  But
it still incurs run-time and memory overhead.  Do we really want
to do it?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug dynamic-link/17711] copy relocations against protected symbols don't work
  2014-12-14 12:43 [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work hjl.tools at gmail dot com
                   ` (5 preceding siblings ...)
  2014-12-17 16:27 ` hjl.tools at gmail dot com
@ 2014-12-17 21:25 ` hjl.tools at gmail dot com
  2015-02-27 21:25 ` hjl.tools at gmail dot com
                   ` (24 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: hjl.tools at gmail dot com @ 2014-12-17 21:25 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17711

--- Comment #6 from H.J. Lu <hjl.tools at gmail dot com> ---
This blocks the current binutils:

/usr/local/bin/ld: copy reloc against protected `protvaritcpt' is invalid
/usr/local/bin/ld: failed to set dynamic section sizes: Bad value
collect2: error: ld returned 1 exit status
make[4]: *** [/export/build/gnu/glibc/build-x86_64-linux/elf/vismain] Error 1

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug dynamic-link/17711] copy relocations against protected symbols don't work
  2014-12-14 12:43 [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work hjl.tools at gmail dot com
                   ` (6 preceding siblings ...)
  2014-12-17 21:25 ` hjl.tools at gmail dot com
@ 2015-02-27 21:25 ` hjl.tools at gmail dot com
  2015-02-27 22:14 ` cvs-commit at gcc dot gnu.org
                   ` (23 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: hjl.tools at gmail dot com @ 2015-02-27 21:25 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17711

--- Comment #7 from H.J. Lu <hjl.tools at gmail dot com> ---
A patch is posted at

https://sourceware.org/ml/libc-alpha/2015-02/msg00777.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug dynamic-link/17711] copy relocations against protected symbols don't work
  2014-12-14 12:43 [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work hjl.tools at gmail dot com
                   ` (7 preceding siblings ...)
  2015-02-27 21:25 ` hjl.tools at gmail dot com
@ 2015-02-27 22:14 ` cvs-commit at gcc dot gnu.org
  2015-02-27 22:16 ` hjl.tools at gmail dot com
                   ` (22 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-02-27 22:14 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17711

--- Comment #8 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  ef4ad06fe5a615af9550d74b1b6d546b9dc0a64d (commit)
      from  2ca725c594e0c186d928dc0823be7d8b5976112c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ef4ad06fe5a615af9550d74b1b6d546b9dc0a64d

commit ef4ad06fe5a615af9550d74b1b6d546b9dc0a64d
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Feb 27 13:56:44 2015 -0800

    Compile vismain with -fPIE and link with -pie

    Protocted symbol in shared library can only be accessed from PIE
    or shared library.  Linker in binutils 2.26 enforces it.  We must
    compile vismain with -fPIE and link it with -pie.

        [BZ #17711]
        * elf/Makefile (tests): Add vismain only if PIE is enabled.
        (tests-pie): Add vismain.
        (CFLAGS-vismain.c): New.
        * elf/vismain.c: Add comments for PIE requirement.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog     |    8 ++++++++
 NEWS          |    8 ++++----
 elf/Makefile  |    5 ++++-
 elf/vismain.c |    5 +++++
 4 files changed, 21 insertions(+), 5 deletions(-)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug dynamic-link/17711] copy relocations against protected symbols don't work
  2014-12-14 12:43 [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work hjl.tools at gmail dot com
                   ` (8 preceding siblings ...)
  2015-02-27 22:14 ` cvs-commit at gcc dot gnu.org
@ 2015-02-27 22:16 ` hjl.tools at gmail dot com
  2015-03-05 23:20 ` hjl.tools at gmail dot com
                   ` (21 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: hjl.tools at gmail dot com @ 2015-02-27 22:16 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17711

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|2.21                        |2.22

--- Comment #9 from H.J. Lu <hjl.tools at gmail dot com> ---
Fixed for 2.22.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug dynamic-link/17711] copy relocations against protected symbols don't work
  2014-12-14 12:43 [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work hjl.tools at gmail dot com
                   ` (9 preceding siblings ...)
  2015-02-27 22:16 ` hjl.tools at gmail dot com
@ 2015-03-05 23:20 ` hjl.tools at gmail dot com
  2015-03-05 23:50 ` cvs-commit at gcc dot gnu.org
                   ` (20 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: hjl.tools at gmail dot com @ 2015-03-05 23:20 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17711

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #10 from H.J. Lu <hjl.tools at gmail dot com> ---
I have a patch to make it to work.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug dynamic-link/17711] copy relocations against protected symbols don't work
  2014-12-14 12:43 [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work hjl.tools at gmail dot com
                   ` (10 preceding siblings ...)
  2015-03-05 23:20 ` hjl.tools at gmail dot com
@ 2015-03-05 23:50 ` cvs-commit at gcc dot gnu.org
  2015-03-06 12:59 ` cvs-commit at gcc dot gnu.org
                   ` (19 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-03-05 23:50 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17711

--- Comment #11 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, hjl/pr17711 has been created
        at  d8d75473ab676234034d4be65f388db8911be2ee (commit)

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=d8d75473ab676234034d4be65f388db8911be2ee

commit d8d75473ab676234034d4be65f388db8911be2ee
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Mar 5 11:36:35 2015 -0800

    Check if linker support for protected data symbol

    Linkers in some versions of binutils 2.25 and 2.26 don't support
    protected data symbol with error messsage like:

    /usr/bin/ld: copy reloc against protected `bar' is invalid
    /usr/bin/ld: failed to set dynamic section sizes: Bad value

    Avoid tests for protected data symbol if linker is broken.

        [BZ #17711]
        * config.make.in (have-protected-data): New.
        * configure.ac: Check linker support for protected data symbol.
        * configure: Regenerated.
        * elf/Makefile (modules-names): Add tst-protected1moda and
        tst-protected1modb if $(have-protected-data) is yes.
        (tests): Add tst-protected1a and tst-protected1b if
        $(have-protected-data) is yes.
        ($(objpfx)tst-protected1a): New.
        ($(objpfx)tst-protected1b): Likewise.
        (tst-protected1modb.so-no-z-defs): Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=91da680526cb0c45764dabb8062aaa4db707546f

commit 91da680526cb0c45764dabb8062aaa4db707546f
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Mar 4 10:24:25 2015 -0800

    Add ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA to x86

    With copy relocation, address of protected data defined in the shared
    library may be external.   When there is a relocation against the
    protected data symbol within the shared library, we need to check if we
    should the definion in the executable copied from this protected data.
    This patch adds ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA and defines it
    for x86.  If ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA isn't 0, do_lookup_x
    will skip the data definion in the executable from copy reloc.

        [BZ #17711]
        * elf/dl-lookup.c (do_lookup_x): When UNDEF_MAP is NULL, which
        indicates it is called from do_lookup_x on relocation against
        protected data, skip the data definion in the executable from
        copy reloc.
        (_dl_lookup_symbol_x): Pass ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA,
        instead of ELF_RTYPE_CLASS_PLT, to do_lookup_x for
        EXTERN_PROTECTED_DATA relocation against STT_OBJECT symbol.
        * sysdeps/generic/ldsodefs.h * (ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA):
        New.  Defined to 4 if DL_EXTERN_PROTECTED_DATA is defined,
        otherwise to 0.
        * sysdeps/i386/dl-lookupcfg.h (DL_EXTERN_PROTECTED_DATA): New.
        * sysdeps/i386/dl-machine.h (elf_machine_type_class): Set class
        to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_386_GLOB_DAT.
        * sysdeps/x86_64/dl-lookupcfg.h (DL_EXTERN_PROTECTED_DATA): New.
        * sysdeps/x86_64/dl-machine.h (elf_machine_type_class): Set class
        to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_X86_64_GLOB_DAT.

-----------------------------------------------------------------------

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug dynamic-link/17711] copy relocations against protected symbols don't work
  2014-12-14 12:43 [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work hjl.tools at gmail dot com
                   ` (11 preceding siblings ...)
  2015-03-05 23:50 ` cvs-commit at gcc dot gnu.org
@ 2015-03-06 12:59 ` cvs-commit at gcc dot gnu.org
  2015-03-06 13:02 ` cvs-commit at gcc dot gnu.org
                   ` (18 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-03-06 12:59 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17711

--- Comment #12 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, hjl/pr17711 has been created
        at  46d7b8634cb39843da59a10e2485d509ce654730 (commit)

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=46d7b8634cb39843da59a10e2485d509ce654730

commit 46d7b8634cb39843da59a10e2485d509ce654730
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Mar 6 04:55:56 2015 -0800

    Replace __attribute__((visibility("protected")))

    With copy relocation, address of protected data defined in the shared
    library may be external.  Compiler shouldn't asssume protected data will
    be local.  But due to

    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248

    __attribute__((visibility("protected"))) doesn't work correctly, we need
    to use asm (".protected xxx") instead.

        * elf/ifuncdep2.c (global): Replace
        __attribute__((visibility("protected"))) with
        asm (".protected xxx").
        * elf/ifuncmod1.c (global): Likewise.
        * elf/ifuncmod5.c (global): Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0f9f3163dc86c805f2f949d93814792d1bca8068

commit 0f9f3163dc86c805f2f949d93814792d1bca8068
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Mar 5 11:36:35 2015 -0800

    Add a testcase for copy reloc against protected data

    Linkers in some versions of binutils 2.25 and 2.26 don't support protected
    data symbol with error messsage like:

    /usr/bin/ld: copy reloc against protected `bar' is invalid
    /usr/bin/ld: failed to set dynamic section sizes: Bad value

    We check if linker supports copy reloc against protected data symbol to
    avoid running the test if linker is broken.

        [BZ #17711]
        * config.make.in (have-protected-data): New.
        * configure.ac: Check linker support for protected data symbol.
        * configure: Regenerated.
        * elf/Makefile (modules-names): Add tst-protected1moda and
        tst-protected1modb if $(have-protected-data) is yes.
        (tests): Add tst-protected1a and tst-protected1b if
        $(have-protected-data) is yes.
        ($(objpfx)tst-protected1a): New.
        ($(objpfx)tst-protected1b): Likewise.
        (tst-protected1modb.so-no-z-defs): Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0352c3c94c5758e4b534c8f576251c9b5bf1f773

commit 0352c3c94c5758e4b534c8f576251c9b5bf1f773
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Mar 4 10:24:25 2015 -0800

    Add ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA to x86

    With copy relocation, address of protected data defined in the shared
    library may be external.   When there is a relocation against the
    protected data symbol within the shared library, we need to check if we
    should skip the definition in the executable copied from the protected
    data.  This patch adds ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA and defines
    it for x86.  If ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA isn't 0, do_lookup_x
    will skip the data definition in the executable from copy reloc.

        [BZ #17711]
        * elf/dl-lookup.c (do_lookup_x): When UNDEF_MAP is NULL, which
        indicates it is called from do_lookup_x on relocation against
        protected data, skip the data definion in the executable from
        copy reloc.
        (_dl_lookup_symbol_x): Pass ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA,
        instead of ELF_RTYPE_CLASS_PLT, to do_lookup_x for
        EXTERN_PROTECTED_DATA relocation against STT_OBJECT symbol.
        * sysdeps/generic/ldsodefs.h * (ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA):
        New.  Defined to 4 if DL_EXTERN_PROTECTED_DATA is defined,
        otherwise to 0.
        * sysdeps/i386/dl-lookupcfg.h (DL_EXTERN_PROTECTED_DATA): New.
        * sysdeps/i386/dl-machine.h (elf_machine_type_class): Set class
        to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_386_GLOB_DAT.
        * sysdeps/x86_64/dl-lookupcfg.h (DL_EXTERN_PROTECTED_DATA): New.
        * sysdeps/x86_64/dl-machine.h (elf_machine_type_class): Set class
        to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_X86_64_GLOB_DAT.

-----------------------------------------------------------------------

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug dynamic-link/17711] copy relocations against protected symbols don't work
  2014-12-14 12:43 [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work hjl.tools at gmail dot com
                   ` (12 preceding siblings ...)
  2015-03-06 12:59 ` cvs-commit at gcc dot gnu.org
@ 2015-03-06 13:02 ` cvs-commit at gcc dot gnu.org
  2015-03-06 19:39 ` cvs-commit at gcc dot gnu.org
                   ` (17 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-03-06 13:02 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17711

--- Comment #13 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, hjl/pr17711 has been created
        at  83855bc9ae7fbd647dfa5ce274cf7106d10bbdf2 (commit)

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=83855bc9ae7fbd647dfa5ce274cf7106d10bbdf2

commit 83855bc9ae7fbd647dfa5ce274cf7106d10bbdf2
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Mar 6 04:55:56 2015 -0800

    Replace __attribute__((visibility("protected")))

    With copy relocation, address of protected data defined in the shared
    library may be external.  Compiler shouldn't asssume protected data will
    be local.  But due to

    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248

    __attribute__((visibility("protected"))) doesn't work correctly, we need
    to use asm (".protected xxx") instead.

        * elf/ifuncdep2.c (global): Replace
        __attribute__((visibility("protected"))) with
        asm (".protected xxx").
        * elf/ifuncmod1.c (global): Likewise.
        * elf/ifuncmod5.c (global): Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=6696be8d29f80d4414bfd4b112b92dad43532516

commit 6696be8d29f80d4414bfd4b112b92dad43532516
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Mar 5 11:36:35 2015 -0800

    Add a testcase for copy reloc against protected data

    Linkers in some versions of binutils 2.25 and 2.26 don't support protected
    data symbol with error messsage like:

    /usr/bin/ld: copy reloc against protected `bar' is invalid
    /usr/bin/ld: failed to set dynamic section sizes: Bad value

    We check if linker supports copy reloc against protected data symbol to
    avoid running the test if linker is broken.

        [BZ #17711]
        * config.make.in (have-protected-data): New.
        * configure.ac: Check linker support for protected data symbol.
        * configure: Regenerated.
        * elf/Makefile (modules-names): Add tst-protected1moda and
        tst-protected1modb if $(have-protected-data) is yes.
        (tests): Add tst-protected1a and tst-protected1b if
        $(have-protected-data) is yes.
        ($(objpfx)tst-protected1a): New.
        ($(objpfx)tst-protected1b): Likewise.
        (tst-protected1modb.so-no-z-defs): Likewise.
        * elf/tst-protected1a.c: New file.
        * elf/tst-protected1b.c: Likewise.
        * elf/tst-protected1mod.h: Likewise.
        * elf/tst-protected1moda.c: Likewise.
        * elf/tst-protected1modb.c: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0352c3c94c5758e4b534c8f576251c9b5bf1f773

commit 0352c3c94c5758e4b534c8f576251c9b5bf1f773
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Mar 4 10:24:25 2015 -0800

    Add ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA to x86

    With copy relocation, address of protected data defined in the shared
    library may be external.   When there is a relocation against the
    protected data symbol within the shared library, we need to check if we
    should skip the definition in the executable copied from the protected
    data.  This patch adds ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA and defines
    it for x86.  If ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA isn't 0, do_lookup_x
    will skip the data definition in the executable from copy reloc.

        [BZ #17711]
        * elf/dl-lookup.c (do_lookup_x): When UNDEF_MAP is NULL, which
        indicates it is called from do_lookup_x on relocation against
        protected data, skip the data definion in the executable from
        copy reloc.
        (_dl_lookup_symbol_x): Pass ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA,
        instead of ELF_RTYPE_CLASS_PLT, to do_lookup_x for
        EXTERN_PROTECTED_DATA relocation against STT_OBJECT symbol.
        * sysdeps/generic/ldsodefs.h * (ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA):
        New.  Defined to 4 if DL_EXTERN_PROTECTED_DATA is defined,
        otherwise to 0.
        * sysdeps/i386/dl-lookupcfg.h (DL_EXTERN_PROTECTED_DATA): New.
        * sysdeps/i386/dl-machine.h (elf_machine_type_class): Set class
        to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_386_GLOB_DAT.
        * sysdeps/x86_64/dl-lookupcfg.h (DL_EXTERN_PROTECTED_DATA): New.
        * sysdeps/x86_64/dl-machine.h (elf_machine_type_class): Set class
        to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_X86_64_GLOB_DAT.

-----------------------------------------------------------------------

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug dynamic-link/17711] copy relocations against protected symbols don't work
  2014-12-14 12:43 [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work hjl.tools at gmail dot com
                   ` (13 preceding siblings ...)
  2015-03-06 13:02 ` cvs-commit at gcc dot gnu.org
@ 2015-03-06 19:39 ` cvs-commit at gcc dot gnu.org
  2015-03-06 21:26 ` cvs-commit at gcc dot gnu.org
                   ` (16 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-03-06 19:39 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17711

--- Comment #14 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, hjl/pr17711 has been created
        at  470cbd0616ae9fe4607680193a75f67ba5b5d1f0 (commit)

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=470cbd0616ae9fe4607680193a75f67ba5b5d1f0

commit 470cbd0616ae9fe4607680193a75f67ba5b5d1f0
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Mar 6 04:55:56 2015 -0800

    Replace __attribute__((visibility("protected")))

    With copy relocation, address of protected data defined in the shared
    library may be external.  Compiler shouldn't asssume protected data will
    be local.  But due to

    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248

    __attribute__((visibility("protected"))) doesn't work correctly, we need
    to use asm (".protected xxx") instead.

        * elf/ifuncdep2.c (global): Replace
        __attribute__((visibility("protected"))) with
        asm (".protected xxx").
        * elf/ifuncmod1.c (global): Likewise.
        * elf/ifuncmod5.c (global): Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ab16864ad041c68a3ae514fc1e9b62e69a037ea2

commit ab16864ad041c68a3ae514fc1e9b62e69a037ea2
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Mar 5 11:36:35 2015 -0800

    Add a testcase for copy reloc against protected data

    Linkers in some versions of binutils 2.25 and 2.26 don't support protected
    data symbol with error messsage like:

    /usr/bin/ld: copy reloc against protected `bar' is invalid
    /usr/bin/ld: failed to set dynamic section sizes: Bad value

    We check if linker supports copy reloc against protected data symbol to
    avoid running the test if linker is broken.

        [BZ #17711]
        * config.make.in (have-protected-data): New.
        * configure.ac: Check linker support for protected data symbol.
        * configure: Regenerated.
        * elf/Makefile (modules-names): Add tst-protected1moda and
        tst-protected1modb if $(have-protected-data) is yes.
        (tests): Add tst-protected1a and tst-protected1b if
        $(have-protected-data) is yes.
        ($(objpfx)tst-protected1a): New.
        ($(objpfx)tst-protected1b): Likewise.
        (tst-protected1modb.so-no-z-defs): Likewise.
        * elf/tst-protected1a.c: New file.
        * elf/tst-protected1b.c: Likewise.
        * elf/tst-protected1mod.h: Likewise.
        * elf/tst-protected1moda.c: Likewise.
        * elf/tst-protected1modb.c: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c39f722201776ac88bf6ed250be5c2490cb56aad

commit c39f722201776ac88bf6ed250be5c2490cb56aad
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Mar 4 10:24:25 2015 -0800

    Add ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA to x86

    With copy relocation, address of protected data defined in the shared
    library may be external.   When there is a relocation against the
    protected data symbol within the shared library, we need to check if we
    should skip the definition in the executable copied from the protected
    data.  This patch adds ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA and defines
    it for x86.  If ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA isn't 0, do_lookup_x
    will skip the data definition in the executable from copy reloc.

        [BZ #17711]
        * elf/dl-lookup.c (do_lookup_x): When UNDEF_MAP is NULL, which
        indicates it is called from do_lookup_x on relocation against
        protected data, skip the data definion in the executable from
        copy reloc.
        (_dl_lookup_symbol_x): Pass ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA,
        instead of ELF_RTYPE_CLASS_PLT, to do_lookup_x for
        EXTERN_PROTECTED_DATA relocation against STT_OBJECT symbol.
        * sysdeps/generic/ldsodefs.h * (ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA):
        New.  Defined to 4 if DL_EXTERN_PROTECTED_DATA is defined,
        otherwise to 0.
        * sysdeps/i386/dl-lookupcfg.h (DL_EXTERN_PROTECTED_DATA): New.
        * sysdeps/i386/dl-machine.h (elf_machine_type_class): Set class
        to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_386_GLOB_DAT.
        * sysdeps/x86_64/dl-lookupcfg.h (DL_EXTERN_PROTECTED_DATA): New.
        * sysdeps/x86_64/dl-machine.h (elf_machine_type_class): Set class
        to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_X86_64_GLOB_DAT.

-----------------------------------------------------------------------

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug dynamic-link/17711] copy relocations against protected symbols don't work
  2014-12-14 12:43 [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work hjl.tools at gmail dot com
                   ` (14 preceding siblings ...)
  2015-03-06 19:39 ` cvs-commit at gcc dot gnu.org
@ 2015-03-06 21:26 ` cvs-commit at gcc dot gnu.org
  2015-03-06 22:56 ` hjl.tools at gmail dot com
                   ` (15 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-03-06 21:26 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17711

--- Comment #15 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, hjl/pr17711 has been created
        at  d7648b9bfd8b5dc1857249dc28fddde08a48629e (commit)

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=d7648b9bfd8b5dc1857249dc28fddde08a48629e

commit d7648b9bfd8b5dc1857249dc28fddde08a48629e
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Mar 6 04:55:56 2015 -0800

    Replace __attribute__((visibility("protected")))

    With copy relocation, address of protected data defined in the shared
    library may be external.  Compiler shouldn't asssume protected data will
    be local.  But due to

    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248

    __attribute__((visibility("protected"))) doesn't work correctly, we need
    to use asm (".protected xxx") instead.

        * elf/ifuncdep2.c (global): Replace
        __attribute__((visibility("protected"))) with
        asm (".protected " __SYMBOL_PREFIX "global").
        * elf/ifuncmod1.c (global): Likewise.
        * elf/ifuncmod5.c (global): Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8b6742da84e216b1ad4104162c76a5e89b07aa64

commit 8b6742da84e216b1ad4104162c76a5e89b07aa64
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Mar 5 11:36:35 2015 -0800

    Add a testcase for copy reloc against protected data

    Linkers in some versions of binutils 2.25 and 2.26 don't support protected
    data symbol with error messsage like:

    /usr/bin/ld: copy reloc against protected `bar' is invalid
    /usr/bin/ld: failed to set dynamic section sizes: Bad value

    We check if linker supports copy reloc against protected data symbol to
    avoid running the test if linker is broken.

        [BZ #17711]
        * config.make.in (have-protected-data): New.
        * configure.ac: Check linker support for protected data symbol.
        * configure: Regenerated.
        * elf/Makefile (modules-names): Add tst-protected1moda and
        tst-protected1modb if $(have-protected-data) is yes.
        (tests): Add tst-protected1a and tst-protected1b if
        $(have-protected-data) is yes.
        ($(objpfx)tst-protected1a): New.
        ($(objpfx)tst-protected1b): Likewise.
        (tst-protected1modb.so-no-z-defs): Likewise.
        * elf/tst-protected1a.c: New file.
        * elf/tst-protected1b.c: Likewise.
        * elf/tst-protected1mod.h: Likewise.
        * elf/tst-protected1moda.c: Likewise.
        * elf/tst-protected1modb.c: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c39f722201776ac88bf6ed250be5c2490cb56aad

commit c39f722201776ac88bf6ed250be5c2490cb56aad
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Mar 4 10:24:25 2015 -0800

    Add ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA to x86

    With copy relocation, address of protected data defined in the shared
    library may be external.   When there is a relocation against the
    protected data symbol within the shared library, we need to check if we
    should skip the definition in the executable copied from the protected
    data.  This patch adds ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA and defines
    it for x86.  If ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA isn't 0, do_lookup_x
    will skip the data definition in the executable from copy reloc.

        [BZ #17711]
        * elf/dl-lookup.c (do_lookup_x): When UNDEF_MAP is NULL, which
        indicates it is called from do_lookup_x on relocation against
        protected data, skip the data definion in the executable from
        copy reloc.
        (_dl_lookup_symbol_x): Pass ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA,
        instead of ELF_RTYPE_CLASS_PLT, to do_lookup_x for
        EXTERN_PROTECTED_DATA relocation against STT_OBJECT symbol.
        * sysdeps/generic/ldsodefs.h * (ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA):
        New.  Defined to 4 if DL_EXTERN_PROTECTED_DATA is defined,
        otherwise to 0.
        * sysdeps/i386/dl-lookupcfg.h (DL_EXTERN_PROTECTED_DATA): New.
        * sysdeps/i386/dl-machine.h (elf_machine_type_class): Set class
        to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_386_GLOB_DAT.
        * sysdeps/x86_64/dl-lookupcfg.h (DL_EXTERN_PROTECTED_DATA): New.
        * sysdeps/x86_64/dl-machine.h (elf_machine_type_class): Set class
        to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_X86_64_GLOB_DAT.

-----------------------------------------------------------------------

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug dynamic-link/17711] copy relocations against protected symbols don't work
  2014-12-14 12:43 [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work hjl.tools at gmail dot com
                   ` (15 preceding siblings ...)
  2015-03-06 21:26 ` cvs-commit at gcc dot gnu.org
@ 2015-03-06 22:56 ` hjl.tools at gmail dot com
  2015-03-06 23:43 ` cvs-commit at gcc dot gnu.org
                   ` (14 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: hjl.tools at gmail dot com @ 2015-03-06 22:56 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17711
Bug 17711 depends on bug 17709, which changed state.

Bug 17709 Summary: [2.26 Regression] elf/vismain test in glibc failed
https://sourceware.org/bugzilla/show_bug.cgi?id=17709

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug dynamic-link/17711] copy relocations against protected symbols don't work
  2014-12-14 12:43 [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work hjl.tools at gmail dot com
                   ` (16 preceding siblings ...)
  2015-03-06 22:56 ` hjl.tools at gmail dot com
@ 2015-03-06 23:43 ` cvs-commit at gcc dot gnu.org
  2015-03-07  0:59 ` cvs-commit at gcc dot gnu.org
                   ` (13 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-03-06 23:43 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17711

--- Comment #16 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, hjl/pr17711 has been created
        at  e351d116a1900cfe75cb11737c787817b524d9c2 (commit)

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e351d116a1900cfe75cb11737c787817b524d9c2

commit e351d116a1900cfe75cb11737c787817b524d9c2
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Mar 6 04:55:56 2015 -0800

    Replace __attribute__((visibility("protected")))

    With copy relocation, address of protected data defined in the shared
    library may be external.  Compiler shouldn't asssume protected data will
    be local.  But due to

    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248

    __attribute__((visibility("protected"))) doesn't work correctly, we need
    to use asm (".protected xxx") instead.

        * elf/ifuncdep2.c (global): Replace
        __attribute__((visibility("protected"))) with
        asm (".protected global").
        * elf/ifuncmod1.c (global): Likewise.
        * elf/ifuncmod5.c (global): Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9ea148bb4763326b8dd62e8b5e076257884334ba

commit 9ea148bb4763326b8dd62e8b5e076257884334ba
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Mar 5 11:36:35 2015 -0800

    Add a testcase for copy reloc against protected data

    Linkers in some versions of binutils 2.25 and 2.26 don't support protected
    data symbol with error messsage like:

    /usr/bin/ld: copy reloc against protected `bar' is invalid
    /usr/bin/ld: failed to set dynamic section sizes: Bad value

    We check if linker supports copy reloc against protected data symbol to
    avoid running the test if linker is broken.

        [BZ #17711]
        * config.make.in (have-protected-data): New.
        * configure.ac: Check linker support for protected data symbol.
        * configure: Regenerated.
        * elf/Makefile (modules-names): Add tst-protected1moda and
        tst-protected1modb if $(have-protected-data) is yes.
        (tests): Add tst-protected1a and tst-protected1b if
        $(have-protected-data) is yes.
        ($(objpfx)tst-protected1a): New.
        ($(objpfx)tst-protected1b): Likewise.
        (tst-protected1modb.so-no-z-defs): Likewise.
        * elf/tst-protected1a.c: New file.
        * elf/tst-protected1b.c: Likewise.
        * elf/tst-protected1mod.h: Likewise.
        * elf/tst-protected1moda.c: Likewise.
        * elf/tst-protected1modb.c: Likewise.

-----------------------------------------------------------------------

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug dynamic-link/17711] copy relocations against protected symbols don't work
  2014-12-14 12:43 [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work hjl.tools at gmail dot com
                   ` (17 preceding siblings ...)
  2015-03-06 23:43 ` cvs-commit at gcc dot gnu.org
@ 2015-03-07  0:59 ` cvs-commit at gcc dot gnu.org
  2015-03-07  1:08 ` cvs-commit at gcc dot gnu.org
                   ` (12 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-03-07  0:59 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17711

--- Comment #17 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, hjl/pr17711 has been created
        at  b3f3e110aefbb41da9acc553891cdfcd6f2c50f0 (commit)

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b3f3e110aefbb41da9acc553891cdfcd6f2c50f0

commit b3f3e110aefbb41da9acc553891cdfcd6f2c50f0
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Mar 6 04:55:56 2015 -0800

    Replace __attribute__((visibility("protected")))

    With copy relocation, address of protected data defined in the shared
    library may be external.  Compiler shouldn't asssume protected data will
    be local.  But due to

    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248

    __attribute__((visibility("protected"))) doesn't work correctly, we need
    to use asm (".protected xxx") instead.

        * elf/ifuncdep2.c (global): Replace
        __attribute__((visibility("protected"))) with
        asm (".protected global").
        * elf/ifuncmod1.c (global): Likewise.
        * elf/ifuncmod5.c (global): Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=88af4693bd32e3658206b73c121de9a36c510f6b

commit 88af4693bd32e3658206b73c121de9a36c510f6b
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Mar 5 11:36:35 2015 -0800

    Add a testcase for copy reloc against protected data

    Linkers in some versions of binutils 2.25 and 2.26 don't support protected
    data symbol with error messsage like:

    /usr/bin/ld: copy reloc against protected `bar' is invalid
    /usr/bin/ld: failed to set dynamic section sizes: Bad value

    We check if linker supports copy reloc against protected data symbol to
    avoid running the test if linker is broken.

        [BZ #17711]
        * config.make.in (have-protected-data): New.
        * configure.ac: Check linker support for protected data symbol.
        * configure: Regenerated.
        * elf/Makefile (modules-names): Add tst-protected1moda and
        tst-protected1modb if $(have-protected-data) is yes.
        (tests): Add tst-protected1a and tst-protected1b if
        $(have-protected-data) is yes.
        ($(objpfx)tst-protected1a): New.
        ($(objpfx)tst-protected1b): Likewise.
        (tst-protected1modb.so-no-z-defs): Likewise.
        * elf/tst-protected1a.c: New file.
        * elf/tst-protected1b.c: Likewise.
        * elf/tst-protected1mod.h: Likewise.
        * elf/tst-protected1moda.c: Likewise.
        * elf/tst-protected1modb.c: Likewise.

-----------------------------------------------------------------------

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug dynamic-link/17711] copy relocations against protected symbols don't work
  2014-12-14 12:43 [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work hjl.tools at gmail dot com
                   ` (18 preceding siblings ...)
  2015-03-07  0:59 ` cvs-commit at gcc dot gnu.org
@ 2015-03-07  1:08 ` cvs-commit at gcc dot gnu.org
  2015-03-07 14:26 ` cvs-commit at gcc dot gnu.org
                   ` (11 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-03-07  1:08 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17711

--- Comment #18 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, hjl/pr17711 has been created
        at  42c245172822ed1228ce4f02a14612e28c805980 (commit)

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=42c245172822ed1228ce4f02a14612e28c805980

commit 42c245172822ed1228ce4f02a14612e28c805980
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Mar 5 11:36:35 2015 -0800

    Add a testcase for copy reloc against protected data

    Linkers in some versions of binutils 2.25 and 2.26 don't support protected
    data symbol with error messsage like:

    /usr/bin/ld: copy reloc against protected `bar' is invalid
    /usr/bin/ld: failed to set dynamic section sizes: Bad value

    We check if linker supports copy reloc against protected data symbol to
    avoid running the test if linker is broken.

        [BZ #17711]
        * config.make.in (have-protected-data): New.
        * configure.ac: Check linker support for protected data symbol.
        * configure: Regenerated.
        * elf/Makefile (modules-names): Add tst-protected1moda and
        tst-protected1modb if $(have-protected-data) is yes.
        (tests): Add tst-protected1a and tst-protected1b if
        $(have-protected-data) is yes.
        ($(objpfx)tst-protected1a): New.
        ($(objpfx)tst-protected1b): Likewise.
        (tst-protected1modb.so-no-z-defs): Likewise.
        * elf/tst-protected1a.c: New file.
        * elf/tst-protected1b.c: Likewise.
        * elf/tst-protected1mod.h: Likewise.
        * elf/tst-protected1moda.c: Likewise.
        * elf/tst-protected1modb.c: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=4c4d74be73833c65ab314d088e10450d8e01663d

commit 4c4d74be73833c65ab314d088e10450d8e01663d
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Mar 4 10:24:25 2015 -0800

    Add ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA to x86

    With copy relocation, address of protected data defined in the shared
    library may be external.   When there is a relocation against the
    protected data symbol within the shared library, we need to check if we
    should skip the definition in the executable copied from the protected
    data.  This patch adds ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA and defines
    it for x86.  If ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA isn't 0, do_lookup_x
    will skip the data definition in the executable from copy reloc.

        [BZ #17711]
        * elf/dl-lookup.c (do_lookup_x): When UNDEF_MAP is NULL, which
        indicates it is called from do_lookup_x on relocation against
        protected data, skip the data definion in the executable from
        copy reloc.
        (_dl_lookup_symbol_x): Pass ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA,
        instead of ELF_RTYPE_CLASS_PLT, to do_lookup_x for
        EXTERN_PROTECTED_DATA relocation against STT_OBJECT symbol.
        * sysdeps/generic/ldsodefs.h * (ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA):
        New.  Defined to 4 if DL_EXTERN_PROTECTED_DATA is defined,
        otherwise to 0.
        * sysdeps/i386/dl-lookupcfg.h (DL_EXTERN_PROTECTED_DATA): New.
        * sysdeps/i386/dl-machine.h (elf_machine_type_class): Set class
        to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_386_GLOB_DAT.
        * sysdeps/x86_64/dl-lookupcfg.h (DL_EXTERN_PROTECTED_DATA): New.
        * sysdeps/x86_64/dl-machine.h (elf_machine_type_class): Set class
        to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_X86_64_GLOB_DAT.

-----------------------------------------------------------------------

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug dynamic-link/17711] copy relocations against protected symbols don't work
  2014-12-14 12:43 [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work hjl.tools at gmail dot com
                   ` (19 preceding siblings ...)
  2015-03-07  1:08 ` cvs-commit at gcc dot gnu.org
@ 2015-03-07 14:26 ` cvs-commit at gcc dot gnu.org
  2015-03-27 17:21 ` hjl.tools at gmail dot com
                   ` (10 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-03-07 14:26 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17711

--- Comment #19 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, hjl/pr17841/master has been created
        at  25de905e5c9280002501af20ac4836795ae8146f (commit)

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=25de905e5c9280002501af20ac4836795ae8146f

commit 25de905e5c9280002501af20ac4836795ae8146f
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Mar 2 14:53:11 2015 -0800

    Compile archives with -fno-pie

    When compiler defaults to PIE, we compile archives with -fno-pie.   Since
    archives won't be used with PIE, compile them with -fpie isn't necessary.

        [BZ #17841]
        * Makeconfig (no-pie-ccflag): New.  Set to -fno-pie.
        (pic-default): Don't define if $(no-pie-ccflag) is -fno-pie.
        (test-object-suffix): New.
        * Makerules (archive-objects): New.  Set before including
        extra-lib.mk.
        ($(archive-objects)): New. New rule to append $(no-pie-ccflag)
        to CFLAGS.
        * extra-lib.mk (archive-objects): New.
        * crypt/Makefile ($(objpfx)md5test): Replace ".o" with
        $(test-object-suffix).
        ($(objpfx)md5test-giant): Likewise.
        ($(objpfx)sha256test): Likewise.
        ($(objpfx)sha512test): Likewise.
        * math/Makefile (LDFLAGS-atest-exp): New.
        (LDFLAGS-atest-sincos): Likewise.
        (LDFLAGS-atest-exp2): Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=01181d5beae0edc4cb7abbc8bb94098a2bea2366

commit 01181d5beae0edc4cb7abbc8bb94098a2bea2366
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jan 14 06:29:04 2015 -0800

    Support compilers defaulting to PIE

    If PIE is the default, we need to build programs as PIE.

        [BZ #17841]
        * Makeconfig (no-pie-ldflag): New.
        (+link): Set to $(+link-pie) if default to PIE.
        (+link-tests): Set to $(+link-pie-tests) if default to PIE.
        * config.make.in (build-pie-default): New.
        * configure.ac (libc_cv_pie_default): New.  Set to yes if -fPIE
        is default.  AC_SUBST.
        * configure: Regenerated.
        * elf/Makefile (LDFLAGS-tst-dlopen-aout): New.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=4ba31feb73f4f700d93e7005e50bdb4835839623

commit 4ba31feb73f4f700d93e7005e50bdb4835839623
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Mar 5 11:36:35 2015 -0800

    Add a testcase for copy reloc against protected data

    Linkers in some versions of binutils 2.25 and 2.26 don't support protected
    data symbol with error messsage like:

    /usr/bin/ld: copy reloc against protected `bar' is invalid
    /usr/bin/ld: failed to set dynamic section sizes: Bad value

    We check if linker supports copy reloc against protected data symbol to
    avoid running the test if linker is broken.

        [BZ #17711]
        * config.make.in (have-protected-data): New.
        * configure.ac: Check linker support for protected data symbol.
        * configure: Regenerated.
        * elf/Makefile (modules-names): Add tst-protected1moda and
        tst-protected1modb if $(have-protected-data) is yes.
        (tests): Add tst-protected1a and tst-protected1b if
        $(have-protected-data) is yes.
        ($(objpfx)tst-protected1a): New.
        ($(objpfx)tst-protected1b): Likewise.
        (tst-protected1modb.so-no-z-defs): Likewise.
        * elf/tst-protected1a.c: New file.
        * elf/tst-protected1b.c: Likewise.
        * elf/tst-protected1mod.h: Likewise.
        * elf/tst-protected1moda.c: Likewise.
        * elf/tst-protected1modb.c: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=6df34771a51884b8cfdc8216e9d07883979ebf84

commit 6df34771a51884b8cfdc8216e9d07883979ebf84
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Mar 4 10:24:25 2015 -0800

    Add ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA to x86

    With copy relocation, address of protected data defined in the shared
    library may be external.   When there is a relocation against the
    protected data symbol within the shared library, we need to check if we
    should skip the definition in the executable copied from the protected
    data.  This patch adds ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA and defines
    it for x86.  If ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA isn't 0, do_lookup_x
    will skip the data definition in the executable from copy reloc.

        [BZ #17711]
        * elf/dl-lookup.c (do_lookup_x): When UNDEF_MAP is NULL, which
        indicates it is called from do_lookup_x on relocation against
        protected data, skip the data definion in the executable from
        copy reloc.
        (_dl_lookup_symbol_x): Pass ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA,
        instead of ELF_RTYPE_CLASS_PLT, to do_lookup_x for
        EXTERN_PROTECTED_DATA relocation against STT_OBJECT symbol.
        * sysdeps/generic/ldsodefs.h * (ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA):
        New.  Defined to 4 if DL_EXTERN_PROTECTED_DATA is defined,
        otherwise to 0.
        * sysdeps/i386/dl-lookupcfg.h (DL_EXTERN_PROTECTED_DATA): New.
        * sysdeps/i386/dl-machine.h (elf_machine_type_class): Set class
        to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_386_GLOB_DAT.
        * sysdeps/x86_64/dl-lookupcfg.h (DL_EXTERN_PROTECTED_DATA): New.
        * sysdeps/x86_64/dl-machine.h (elf_machine_type_class): Set class
        to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_X86_64_GLOB_DAT.

-----------------------------------------------------------------------

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug dynamic-link/17711] copy relocations against protected symbols don't work
  2014-12-14 12:43 [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work hjl.tools at gmail dot com
                   ` (20 preceding siblings ...)
  2015-03-07 14:26 ` cvs-commit at gcc dot gnu.org
@ 2015-03-27 17:21 ` hjl.tools at gmail dot com
  2015-03-31 12:17 ` cvs-commit at gcc dot gnu.org
                   ` (9 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: hjl.tools at gmail dot com @ 2015-03-27 17:21 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17711

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |NEW
           Assignee|unassigned at sourceware dot org   |hjl.tools at gmail dot com

--- Comment #20 from H.J. Lu <hjl.tools at gmail dot com> ---
Created attachment 8214
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8214&action=edit
A testcase

[hjl@gnu-tools-1 pr17711]$ make
gcc  -B./ -g   -c -o x.o x.c
gcc  -B./ -g -fPIC   -c -o bar.o bar.c
ld -shared -o libbar.so bar.o
gcc  -B./  -o x x.o libbar.so -Wl,-rpath,.
./x
Makefile:12: recipe for target 'all' failed
make: *** [all] Aborted (core dumped)
[hjl@gnu-tools-1 pr17711]$

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug dynamic-link/17711] copy relocations against protected symbols don't work
  2014-12-14 12:43 [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work hjl.tools at gmail dot com
                   ` (21 preceding siblings ...)
  2015-03-27 17:21 ` hjl.tools at gmail dot com
@ 2015-03-31 12:17 ` cvs-commit at gcc dot gnu.org
  2015-03-31 12:22 ` cvs-commit at gcc dot gnu.org
                   ` (8 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-03-31 12:17 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17711

--- Comment #21 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  62da1e3b00b51383ffa7efc89d8addda0502e107 (commit)
      from  675ddb7184f642263331b13ac7bf726536504f97 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=62da1e3b00b51383ffa7efc89d8addda0502e107

commit 62da1e3b00b51383ffa7efc89d8addda0502e107
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Mar 31 05:15:43 2015 -0700

    Add ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA to x86

    With copy relocation, address of protected data defined in the shared
    library may be external.   When there is a relocation against the
    protected data symbol within the shared library, we need to check if we
    should skip the definition in the executable copied from the protected
    data.  This patch adds ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA and defines
    it for x86.  If ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA isn't 0, do_lookup_x
    will skip the data definition in the executable from copy reloc.

        [BZ #17711]
        * elf/dl-lookup.c (do_lookup_x): When UNDEF_MAP is NULL, which
        indicates it is called from do_lookup_x on relocation against
        protected data, skip the data definion in the executable from
        copy reloc.
        (_dl_lookup_symbol_x): Pass ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA,
        instead of ELF_RTYPE_CLASS_PLT, to do_lookup_x for
        EXTERN_PROTECTED_DATA relocation against STT_OBJECT symbol.
        * sysdeps/generic/ldsodefs.h * (ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA):
        New.  Defined to 4 if DL_EXTERN_PROTECTED_DATA is defined,
        otherwise to 0.
        * sysdeps/i386/dl-lookupcfg.h (DL_EXTERN_PROTECTED_DATA): New.
        * sysdeps/i386/dl-machine.h (elf_machine_type_class): Set class
        to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_386_GLOB_DAT.
        * sysdeps/x86_64/dl-lookupcfg.h (DL_EXTERN_PROTECTED_DATA): New.
        * sysdeps/x86_64/dl-machine.h (elf_machine_type_class): Set class
        to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_X86_64_GLOB_DAT.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                     |   20 +++++++++++++
 elf/dl-lookup.c               |   61 ++++++++++++++++++++++++++++++++++++++++-
 sysdeps/generic/ldsodefs.h    |   12 +++++++-
 sysdeps/i386/dl-lookupcfg.h   |    4 +++
 sysdeps/i386/dl-machine.h     |    8 ++++-
 sysdeps/x86_64/dl-lookupcfg.h |    4 +++
 sysdeps/x86_64/dl-machine.h   |    8 ++++-
 7 files changed, 111 insertions(+), 6 deletions(-)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug dynamic-link/17711] copy relocations against protected symbols don't work
  2014-12-14 12:43 [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work hjl.tools at gmail dot com
                   ` (22 preceding siblings ...)
  2015-03-31 12:17 ` cvs-commit at gcc dot gnu.org
@ 2015-03-31 12:22 ` cvs-commit at gcc dot gnu.org
  2015-04-01  0:02 ` cvs-commit at gcc dot gnu.org
                   ` (7 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-03-31 12:22 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17711

--- Comment #22 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  83569fb894050db7430047da2219ca50c68f882a (commit)
      from  62da1e3b00b51383ffa7efc89d8addda0502e107 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=83569fb894050db7430047da2219ca50c68f882a

commit 83569fb894050db7430047da2219ca50c68f882a
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Mar 31 05:20:55 2015 -0700

    Add a testcase for copy reloc against protected data

    Linkers in some versions of binutils 2.25 and 2.26 don't support protected
    data symbol with error messsage like:

    /usr/bin/ld: copy reloc against protected `bar' is invalid
    /usr/bin/ld: failed to set dynamic section sizes: Bad value

    We check if linker supports copy reloc against protected data symbol to
    avoid running the test if linker is broken.

        [BZ #17711]
        * config.make.in (have-protected-data): New.
        * configure.ac: Check linker support for protected data symbol.
        * configure: Regenerated.
        * elf/Makefile (modules-names): Add tst-protected1moda and
        tst-protected1modb if $(have-protected-data) is yes.
        (tests): Add tst-protected1a and tst-protected1b if
        $(have-protected-data) is yes.
        ($(objpfx)tst-protected1a): New.
        ($(objpfx)tst-protected1b): Likewise.
        (tst-protected1modb.so-no-z-defs): Likewise.
        * elf/tst-protected1a.c: New file.
        * elf/tst-protected1b.c: Likewise.
        * elf/tst-protected1mod.h: Likewise.
        * elf/tst-protected1moda.c: Likewise.
        * elf/tst-protected1modb.c: Likewise.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                |   19 ++++
 config.make.in           |    1 +
 configure                |   40 ++++++++
 configure.ac             |   23 +++++
 elf/Makefile             |    7 ++
 elf/tst-protected1a.c    |  236 ++++++++++++++++++++++++++++++++++++++++++++
 elf/tst-protected1b.c    |  242 ++++++++++++++++++++++++++++++++++++++++++++++
 elf/tst-protected1mod.h  |   41 ++++++++
 elf/tst-protected1moda.c |   92 +++++++++++++++++
 elf/tst-protected1modb.c |   62 ++++++++++++
 10 files changed, 763 insertions(+), 0 deletions(-)
 create mode 100644 elf/tst-protected1a.c
 create mode 100644 elf/tst-protected1b.c
 create mode 100644 elf/tst-protected1mod.h
 create mode 100644 elf/tst-protected1moda.c
 create mode 100644 elf/tst-protected1modb.c

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug dynamic-link/17711] copy relocations against protected symbols don't work
  2014-12-14 12:43 [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work hjl.tools at gmail dot com
                   ` (23 preceding siblings ...)
  2015-03-31 12:22 ` cvs-commit at gcc dot gnu.org
@ 2015-04-01  0:02 ` cvs-commit at gcc dot gnu.org
  2015-04-01  0:05 ` cvs-commit at gcc dot gnu.org
                   ` (6 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-04-01  0:02 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17711

--- Comment #23 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, hjl/pr17711/2.21 has been created
        at  26b173a5ba1dcb217d2a2f29f8e7c0c4efe4e1b4 (commit)

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=26b173a5ba1dcb217d2a2f29f8e7c0c4efe4e1b4

commit 26b173a5ba1dcb217d2a2f29f8e7c0c4efe4e1b4
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Mar 5 11:36:35 2015 -0800

    Add a testcase for copy reloc against protected data

    Linkers in some versions of binutils 2.25 and 2.26 don't support protected
    data symbol with error messsage like:

    /usr/bin/ld: copy reloc against protected `bar' is invalid
    /usr/bin/ld: failed to set dynamic section sizes: Bad value

    We check if linker supports copy reloc against protected data symbol to
    avoid running the test if linker is broken.

        [BZ #17711]
        * config.make.in (have-protected-data): New.
        * configure.ac: Check linker support for protected data symbol.
        * configure: Regenerated.
        * elf/Makefile (modules-names): Add tst-protected1moda and
        tst-protected1modb if $(have-protected-data) is yes.
        (tests): Add tst-protected1a and tst-protected1b if
        $(have-protected-data) is yes.
        ($(objpfx)tst-protected1a): New.
        ($(objpfx)tst-protected1b): Likewise.
        (tst-protected1modb.so-no-z-defs): Likewise.
        * elf/tst-protected1a.c: New file.
        * elf/tst-protected1b.c: Likewise.
        * elf/tst-protected1mod.h: Likewise.
        * elf/tst-protected1moda.c: Likewise.
        * elf/tst-protected1modb.c: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9024cd9cf032a49c6e08ec54737430f913409abb

commit 9024cd9cf032a49c6e08ec54737430f913409abb
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Mar 31 05:15:43 2015 -0700

    Add ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA to x86

    With copy relocation, address of protected data defined in the shared
    library may be external.   When there is a relocation against the
    protected data symbol within the shared library, we need to check if we
    should skip the definition in the executable copied from the protected
    data.  This patch adds ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA and defines
    it for x86.  If ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA isn't 0, do_lookup_x
    will skip the data definition in the executable from copy reloc.

    Cherry-pick from master: 62da1e3b00b51383ffa7efc89d8addda0502e107
        [BZ #17711]
        * elf/dl-lookup.c (do_lookup_x): When UNDEF_MAP is NULL, which
        indicates it is called from do_lookup_x on relocation against
        protected data, skip the data definion in the executable from
        copy reloc.
        (_dl_lookup_symbol_x): Pass ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA,
        instead of ELF_RTYPE_CLASS_PLT, to do_lookup_x for
        EXTERN_PROTECTED_DATA relocation against STT_OBJECT symbol.
        * sysdeps/generic/ldsodefs.h * (ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA):
        New.  Defined to 4 if DL_EXTERN_PROTECTED_DATA is defined,
        otherwise to 0.
        * sysdeps/i386/dl-lookupcfg.h (DL_EXTERN_PROTECTED_DATA): New.
        * sysdeps/i386/dl-machine.h (elf_machine_type_class): Set class
        to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_386_GLOB_DAT.
        * sysdeps/x86_64/dl-lookupcfg.h (DL_EXTERN_PROTECTED_DATA): New.
        * sysdeps/x86_64/dl-machine.h (elf_machine_type_class): Set class
        to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_X86_64_GLOB_DAT.

-----------------------------------------------------------------------

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug dynamic-link/17711] copy relocations against protected symbols don't work
  2014-12-14 12:43 [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work hjl.tools at gmail dot com
                   ` (24 preceding siblings ...)
  2015-04-01  0:02 ` cvs-commit at gcc dot gnu.org
@ 2015-04-01  0:05 ` cvs-commit at gcc dot gnu.org
  2015-04-01  0:07 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-04-01  0:05 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17711

--- Comment #24 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, hjl/pr17711/2.21 has been created
        at  15974929ebe95f25f8617860c14fbefd3a8ea689 (commit)

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=15974929ebe95f25f8617860c14fbefd3a8ea689

commit 15974929ebe95f25f8617860c14fbefd3a8ea689
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Mar 5 11:36:35 2015 -0800

    Add a testcase for copy reloc against protected data

    Linkers in some versions of binutils 2.25 and 2.26 don't support protected
    data symbol with error messsage like:

    /usr/bin/ld: copy reloc against protected `bar' is invalid
    /usr/bin/ld: failed to set dynamic section sizes: Bad value

    We check if linker supports copy reloc against protected data symbol to
    avoid running the test if linker is broken.

    Cherry-pick from master: 83569fb894050db7430047da2219ca50c68f882a
        [BZ #17711]
        * config.make.in (have-protected-data): New.
        * configure.ac: Check linker support for protected data symbol.
        * configure: Regenerated.
        * elf/Makefile (modules-names): Add tst-protected1moda and
        tst-protected1modb if $(have-protected-data) is yes.
        (tests): Add tst-protected1a and tst-protected1b if
        $(have-protected-data) is yes.
        ($(objpfx)tst-protected1a): New.
        ($(objpfx)tst-protected1b): Likewise.
        (tst-protected1modb.so-no-z-defs): Likewise.
        * elf/tst-protected1a.c: New file.
        * elf/tst-protected1b.c: Likewise.
        * elf/tst-protected1mod.h: Likewise.
        * elf/tst-protected1moda.c: Likewise.
        * elf/tst-protected1modb.c: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9024cd9cf032a49c6e08ec54737430f913409abb

commit 9024cd9cf032a49c6e08ec54737430f913409abb
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Mar 31 05:15:43 2015 -0700

    Add ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA to x86

    With copy relocation, address of protected data defined in the shared
    library may be external.   When there is a relocation against the
    protected data symbol within the shared library, we need to check if we
    should skip the definition in the executable copied from the protected
    data.  This patch adds ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA and defines
    it for x86.  If ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA isn't 0, do_lookup_x
    will skip the data definition in the executable from copy reloc.

    Cherry-pick from master: 62da1e3b00b51383ffa7efc89d8addda0502e107
        [BZ #17711]
        * elf/dl-lookup.c (do_lookup_x): When UNDEF_MAP is NULL, which
        indicates it is called from do_lookup_x on relocation against
        protected data, skip the data definion in the executable from
        copy reloc.
        (_dl_lookup_symbol_x): Pass ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA,
        instead of ELF_RTYPE_CLASS_PLT, to do_lookup_x for
        EXTERN_PROTECTED_DATA relocation against STT_OBJECT symbol.
        * sysdeps/generic/ldsodefs.h * (ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA):
        New.  Defined to 4 if DL_EXTERN_PROTECTED_DATA is defined,
        otherwise to 0.
        * sysdeps/i386/dl-lookupcfg.h (DL_EXTERN_PROTECTED_DATA): New.
        * sysdeps/i386/dl-machine.h (elf_machine_type_class): Set class
        to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_386_GLOB_DAT.
        * sysdeps/x86_64/dl-lookupcfg.h (DL_EXTERN_PROTECTED_DATA): New.
        * sysdeps/x86_64/dl-machine.h (elf_machine_type_class): Set class
        to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_X86_64_GLOB_DAT.

-----------------------------------------------------------------------

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug dynamic-link/17711] copy relocations against protected symbols don't work
  2014-12-14 12:43 [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work hjl.tools at gmail dot com
                   ` (25 preceding siblings ...)
  2015-04-01  0:05 ` cvs-commit at gcc dot gnu.org
@ 2015-04-01  0:07 ` cvs-commit at gcc dot gnu.org
  2015-04-01  0:19 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-04-01  0:07 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17711

--- Comment #25 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, hjl/pr17711/2.20 has been created
        at  556b3041f288ede13912ff72bdee59139af7257c (commit)

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=556b3041f288ede13912ff72bdee59139af7257c

commit 556b3041f288ede13912ff72bdee59139af7257c
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Mar 5 11:36:35 2015 -0800

    Add a testcase for copy reloc against protected data

    Linkers in some versions of binutils 2.25 and 2.26 don't support protected
    data symbol with error messsage like:

    /usr/bin/ld: copy reloc against protected `bar' is invalid
    /usr/bin/ld: failed to set dynamic section sizes: Bad value

    We check if linker supports copy reloc against protected data symbol to
    avoid running the test if linker is broken.

    Cherry-pick from master: 83569fb894050db7430047da2219ca50c68f882a
        [BZ #17711]
        * config.make.in (have-protected-data): New.
        * configure.ac: Check linker support for protected data symbol.
        * configure: Regenerated.
        * elf/Makefile (modules-names): Add tst-protected1moda and
        tst-protected1modb if $(have-protected-data) is yes.
        (tests): Add tst-protected1a and tst-protected1b if
        $(have-protected-data) is yes.
        ($(objpfx)tst-protected1a): New.
        ($(objpfx)tst-protected1b): Likewise.
        (tst-protected1modb.so-no-z-defs): Likewise.
        * elf/tst-protected1a.c: New file.
        * elf/tst-protected1b.c: Likewise.
        * elf/tst-protected1mod.h: Likewise.
        * elf/tst-protected1moda.c: Likewise.
        * elf/tst-protected1modb.c: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=d817d6f3d6f3bde4b7e2d85a8d6dccd418d701c7

commit d817d6f3d6f3bde4b7e2d85a8d6dccd418d701c7
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Mar 31 05:15:43 2015 -0700

    Add ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA to x86

    With copy relocation, address of protected data defined in the shared
    library may be external.   When there is a relocation against the
    protected data symbol within the shared library, we need to check if we
    should skip the definition in the executable copied from the protected
    data.  This patch adds ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA and defines
    it for x86.  If ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA isn't 0, do_lookup_x
    will skip the data definition in the executable from copy reloc.

    Cherry-pick from master: 62da1e3b00b51383ffa7efc89d8addda0502e107
        [BZ #17711]
        * elf/dl-lookup.c (do_lookup_x): When UNDEF_MAP is NULL, which
        indicates it is called from do_lookup_x on relocation against
        protected data, skip the data definion in the executable from
        copy reloc.
        (_dl_lookup_symbol_x): Pass ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA,
        instead of ELF_RTYPE_CLASS_PLT, to do_lookup_x for
        EXTERN_PROTECTED_DATA relocation against STT_OBJECT symbol.
        * sysdeps/generic/ldsodefs.h * (ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA):
        New.  Defined to 4 if DL_EXTERN_PROTECTED_DATA is defined,
        otherwise to 0.
        * sysdeps/i386/dl-lookupcfg.h (DL_EXTERN_PROTECTED_DATA): New.
        * sysdeps/i386/dl-machine.h (elf_machine_type_class): Set class
        to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_386_GLOB_DAT.
        * sysdeps/x86_64/dl-lookupcfg.h (DL_EXTERN_PROTECTED_DATA): New.
        * sysdeps/x86_64/dl-machine.h (elf_machine_type_class): Set class
        to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_X86_64_GLOB_DAT.

-----------------------------------------------------------------------

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug dynamic-link/17711] copy relocations against protected symbols don't work
  2014-12-14 12:43 [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work hjl.tools at gmail dot com
                   ` (26 preceding siblings ...)
  2015-04-01  0:07 ` cvs-commit at gcc dot gnu.org
@ 2015-04-01  0:19 ` cvs-commit at gcc dot gnu.org
  2015-04-01  0:28 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-04-01  0:19 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17711

--- Comment #26 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, hjl/pr17711/2.19 has been created
        at  b5344eca1895da9192fb4b9c2c470a40e41dda03 (commit)

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b5344eca1895da9192fb4b9c2c470a40e41dda03

commit b5344eca1895da9192fb4b9c2c470a40e41dda03
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Mar 5 11:36:35 2015 -0800

    Add a testcase for copy reloc against protected data

    Linkers in some versions of binutils 2.25 and 2.26 don't support protected
    data symbol with error messsage like:

    /usr/bin/ld: copy reloc against protected `bar' is invalid
    /usr/bin/ld: failed to set dynamic section sizes: Bad value

    We check if linker supports copy reloc against protected data symbol to
    avoid running the test if linker is broken.

    Cherry-pick from master: 83569fb894050db7430047da2219ca50c68f882a
        [BZ #17711]
        * config.make.in (have-protected-data): New.
        * configure.ac: Check linker support for protected data symbol.
        * configure: Regenerated.
        * elf/Makefile (modules-names): Add tst-protected1moda and
        tst-protected1modb if $(have-protected-data) is yes.
        (tests): Add tst-protected1a and tst-protected1b if
        $(have-protected-data) is yes.
        ($(objpfx)tst-protected1a): New.
        ($(objpfx)tst-protected1b): Likewise.
        (tst-protected1modb.so-no-z-defs): Likewise.
        * elf/tst-protected1a.c: New file.
        * elf/tst-protected1b.c: Likewise.
        * elf/tst-protected1mod.h: Likewise.
        * elf/tst-protected1moda.c: Likewise.
        * elf/tst-protected1modb.c: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c5cd4843e79d71c2776eac3602ced23ab4e4b8d0

commit c5cd4843e79d71c2776eac3602ced23ab4e4b8d0
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Mar 31 05:15:43 2015 -0700

    Add ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA to x86

    With copy relocation, address of protected data defined in the shared
    library may be external.   When there is a relocation against the
    protected data symbol within the shared library, we need to check if we
    should skip the definition in the executable copied from the protected
    data.  This patch adds ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA and defines
    it for x86.  If ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA isn't 0, do_lookup_x
    will skip the data definition in the executable from copy reloc.

    Cherry-pick from master: 62da1e3b00b51383ffa7efc89d8addda0502e107
        [BZ #17711]
        * elf/dl-lookup.c (do_lookup_x): When UNDEF_MAP is NULL, which
        indicates it is called from do_lookup_x on relocation against
        protected data, skip the data definion in the executable from
        copy reloc.
        (_dl_lookup_symbol_x): Pass ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA,
        instead of ELF_RTYPE_CLASS_PLT, to do_lookup_x for
        EXTERN_PROTECTED_DATA relocation against STT_OBJECT symbol.
        * sysdeps/generic/ldsodefs.h * (ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA):
        New.  Defined to 4 if DL_EXTERN_PROTECTED_DATA is defined,
        otherwise to 0.
        * sysdeps/i386/dl-lookupcfg.h (DL_EXTERN_PROTECTED_DATA): New.
        * sysdeps/i386/dl-machine.h (elf_machine_type_class): Set class
        to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_386_GLOB_DAT.
        * sysdeps/x86_64/dl-lookupcfg.h (DL_EXTERN_PROTECTED_DATA): New.
        * sysdeps/x86_64/dl-machine.h (elf_machine_type_class): Set class
        to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_X86_64_GLOB_DAT.

-----------------------------------------------------------------------

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug dynamic-link/17711] copy relocations against protected symbols don't work
  2014-12-14 12:43 [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work hjl.tools at gmail dot com
                   ` (27 preceding siblings ...)
  2015-04-01  0:19 ` cvs-commit at gcc dot gnu.org
@ 2015-04-01  0:28 ` cvs-commit at gcc dot gnu.org
  2015-07-11 19:46 ` neleai at seznam dot cz
                   ` (2 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-04-01  0:28 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17711

--- Comment #27 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, hjl/pr17711/2.18 has been created
        at  3350e1867c0b82957093fa9e1c52a5f841881377 (commit)

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3350e1867c0b82957093fa9e1c52a5f841881377

commit 3350e1867c0b82957093fa9e1c52a5f841881377
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Mar 6 04:55:56 2015 -0800

    Replace __attribute__((visibility("protected")))

    With copy relocation, address of protected data defined in the shared
    library may be external.  Compiler shouldn't asssume protected data will
    be local.  But due to

    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248

    __attribute__((visibility("protected"))) doesn't work correctly, we need
    to use asm (".protected xxx") instead.

    Cherry-pick from master: e0ed2fb40a0e29c43cf60addc74741dab15f2e05
        * elf/ifuncdep2.c (global): Replace
        __attribute__((visibility("protected"))) with
        asm (".protected global").
        * elf/ifuncmod1.c (global): Likewise.
        * elf/ifuncmod5.c (global): Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a0f66d616575074b0f569da3f561fa0fe09fa312

commit a0f66d616575074b0f569da3f561fa0fe09fa312
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Mar 5 11:36:35 2015 -0800

    Add a testcase for copy reloc against protected data

    Linkers in some versions of binutils 2.25 and 2.26 don't support protected
    data symbol with error messsage like:

    /usr/bin/ld: copy reloc against protected `bar' is invalid
    /usr/bin/ld: failed to set dynamic section sizes: Bad value

    We check if linker supports copy reloc against protected data symbol to
    avoid running the test if linker is broken.

    Cherry-pick from master: 83569fb894050db7430047da2219ca50c68f882a
        [BZ #17711]
        * config.make.in (have-protected-data): New.
        * configure.ac: Check linker support for protected data symbol.
        * configure: Regenerated.
        * elf/Makefile (modules-names): Add tst-protected1moda and
        tst-protected1modb if $(have-protected-data) is yes.
        (tests): Add tst-protected1a and tst-protected1b if
        $(have-protected-data) is yes.
        ($(objpfx)tst-protected1a): New.
        ($(objpfx)tst-protected1b): Likewise.
        (tst-protected1modb.so-no-z-defs): Likewise.
        * elf/tst-protected1a.c: New file.
        * elf/tst-protected1b.c: Likewise.
        * elf/tst-protected1mod.h: Likewise.
        * elf/tst-protected1moda.c: Likewise.
        * elf/tst-protected1modb.c: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=79bb575bc9160f0be7c6770de56e9240fada34c0

commit 79bb575bc9160f0be7c6770de56e9240fada34c0
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Mar 31 05:15:43 2015 -0700

    Add ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA to x86

    With copy relocation, address of protected data defined in the shared
    library may be external.   When there is a relocation against the
    protected data symbol within the shared library, we need to check if we
    should skip the definition in the executable copied from the protected
    data.  This patch adds ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA and defines
    it for x86.  If ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA isn't 0, do_lookup_x
    will skip the data definition in the executable from copy reloc.

    Cherry-pick from master: 62da1e3b00b51383ffa7efc89d8addda0502e107
        [BZ #17711]
        * elf/dl-lookup.c (do_lookup_x): When UNDEF_MAP is NULL, which
        indicates it is called from do_lookup_x on relocation against
        protected data, skip the data definion in the executable from
        copy reloc.
        (_dl_lookup_symbol_x): Pass ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA,
        instead of ELF_RTYPE_CLASS_PLT, to do_lookup_x for
        EXTERN_PROTECTED_DATA relocation against STT_OBJECT symbol.
        * sysdeps/generic/ldsodefs.h * (ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA):
        New.  Defined to 4 if DL_EXTERN_PROTECTED_DATA is defined,
        otherwise to 0.
        * sysdeps/i386/dl-lookupcfg.h (DL_EXTERN_PROTECTED_DATA): New.
        * sysdeps/i386/dl-machine.h (elf_machine_type_class): Set class
        to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_386_GLOB_DAT.
        * sysdeps/x86_64/dl-lookupcfg.h (DL_EXTERN_PROTECTED_DATA): New.
        * sysdeps/x86_64/dl-machine.h (elf_machine_type_class): Set class
        to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_X86_64_GLOB_DAT.

-----------------------------------------------------------------------

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug dynamic-link/17711] copy relocations against protected symbols don't work
  2014-12-14 12:43 [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work hjl.tools at gmail dot com
                   ` (28 preceding siblings ...)
  2015-04-01  0:28 ` cvs-commit at gcc dot gnu.org
@ 2015-07-11 19:46 ` neleai at seznam dot cz
  2015-07-24  9:08 ` cvs-commit at gcc dot gnu.org
  2015-08-02  3:55 ` cvs-commit at gcc dot gnu.org
  31 siblings, 0 replies; 33+ messages in thread
From: neleai at seznam dot cz @ 2015-07-11 19:46 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17711

Ondrej Bilka <neleai at seznam dot cz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |neleai at seznam dot cz
         Resolution|---                         |FIXED

--- Comment #28 from Ondrej Bilka <neleai at seznam dot cz> ---
Fixed

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug dynamic-link/17711] copy relocations against protected symbols don't work
  2014-12-14 12:43 [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work hjl.tools at gmail dot com
                   ` (29 preceding siblings ...)
  2015-07-11 19:46 ` neleai at seznam dot cz
@ 2015-07-24  9:08 ` cvs-commit at gcc dot gnu.org
  2015-08-02  3:55 ` cvs-commit at gcc dot gnu.org
  31 siblings, 0 replies; 33+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-07-24  9:08 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17711

--- Comment #29 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  3bcea719ddd6ce399d7bccb492c40af77d216e42 (commit)
       via  0910702c4d2cf9e8302b35c9519548726e1ac489 (commit)
      from  a81a00ff94a43af85f7aefceb6d31f3c0f11151d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3bcea719ddd6ce399d7bccb492c40af77d216e42

commit 3bcea719ddd6ce399d7bccb492c40af77d216e42
Author: Szabolcs Nagy <nsz@port70.net>
Date:   Fri Jul 24 10:05:07 2015 +0100

    [ARM][BZ #17711] Fix extern protected data handling

    Fixes elf/tst-protected1a and elf/tst-protected1b tests.

    Depends on a gcc patch that makes protected visibility data non-local:
    https://gcc.gnu.org/ml/gcc-patches/2015-07/msg01871.html
    and on a binutils patch so R_*_GLOB_DAT relocs are used for it:
    https://sourceware.org/ml/binutils/2015-07/msg00247.html

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0910702c4d2cf9e8302b35c9519548726e1ac489

commit 0910702c4d2cf9e8302b35c9519548726e1ac489
Author: Szabolcs Nagy <nsz@port70.net>
Date:   Fri Jul 24 09:57:32 2015 +0100

    [AArch64][BZ #17711] Fix extern protected data handling

    Fixes elf/tst-protected1a and elf/tst-protected1b tests.

    Depends on a gcc patch that makes protected visibility data non-local:
    https://gcc.gnu.org/ml/gcc-patches/2015-07/msg01871.html
    and on a binutils patch so R_*_GLOB_DAT relocs are used for it:
    https://sourceware.org/ml/binutils/2015-07/msg00246.html

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                    |   10 ++++++++++
 sysdeps/aarch64/dl-machine.h |    3 ++-
 sysdeps/aarch64/dl-sysdep.h  |    2 ++
 sysdeps/arm/dl-machine.h     |   10 +++++++---
 sysdeps/arm/dl-sysdep.h      |    2 ++
 5 files changed, 23 insertions(+), 4 deletions(-)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug dynamic-link/17711] copy relocations against protected symbols don't work
  2014-12-14 12:43 [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work hjl.tools at gmail dot com
                   ` (30 preceding siblings ...)
  2015-07-24  9:08 ` cvs-commit at gcc dot gnu.org
@ 2015-08-02  3:55 ` cvs-commit at gcc dot gnu.org
  31 siblings, 0 replies; 33+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-08-02  3:55 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17711

--- Comment #30 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, hjl/plt/2.21 has been created
        at  555186f0c71fee41e33ad72cb38be974221b2e3c (commit)

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=555186f0c71fee41e33ad72cb38be974221b2e3c

commit 555186f0c71fee41e33ad72cb38be974221b2e3c
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 29 04:49:38 2015 -0700

    Use SSE optimized strcmp in x86-64 ld.so

    Since ld.so preserves vector registers now, we can SSE optimized strcmp
    in x86-64 ld.so.

        * sysdeps/x86_64/strcmp.S: Remove "#if !IS_IN (libc)".

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=40258193697061c87e5cfe285cd04adcf1ae655f

commit 40258193697061c87e5cfe285cd04adcf1ae655f
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 29 03:56:14 2015 -0700

    Remove x86-64 rtld-xxx.c and rtld-xxx.S

    Since ld.so preserves vector registers now, we can use the regular,
    non-ifunc string and memory functions in ld.so.

        * sysdeps/x86_64/rtld-memcmp.c: Removed.
        * sysdeps/x86_64/rtld-memset.S: Likewise.
        * sysdeps/x86_64/rtld-strchr.S: Likewise.
        * sysdeps/x86_64/rtld-strlen.S: Likewise.
        * sysdeps/x86_64/multiarch/rtld-memcmp.c: Likewise.
        * sysdeps/x86_64/multiarch/rtld-memset.S: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a687fe847371d763d6fef546bd8efe82a8f88d40

commit a687fe847371d763d6fef546bd8efe82a8f88d40
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 29 03:47:54 2015 -0700

    Replace %xmm8 with %xmm0

    Since ld.so preserves vector registers now, we can use %xmm0 to avoid
    the REX prefix.

        * sysdeps/x86_64/memset.S: Replace %xmm8 with %xmm0.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5ad67d1f4b30eada1bf262566213dcca2e3893f7

commit 5ad67d1f4b30eada1bf262566213dcca2e3893f7
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 29 03:44:39 2015 -0700

    Replace %xmm[8-12] with %xmm[0-4]

    Since ld.so preserves vector registers now, we can use %xmm[0-4] to
    avoid the REX prefix.

        * sysdeps/x86_64/strlen.S: Replace %xmm[8-12] with %xmm[0-4].

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=fb086134f5eba610a4020e655dce46b75302d81c

commit fb086134f5eba610a4020e655dce46b75302d81c
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Jul 28 18:56:18 2015 -0700

    Don't disable SSE in x86-64 ld.so

    Since ld.so preserves vector registers now, we can use SSE in ld.so.

        * sysdeps/i386/Makefile [$(subdir) == elf] (CFLAGS-.os): Add
        -mno-sse -mno-mmx for $(all-rtld-routines).
        [$(subdir) == elf] (tests-special): Add
        $(objpfx)tst-ld-sse-use.out.
        [$(subdir) == elf] ($(objpfx)tst-ld-sse-use.out): New rule.
        * sysdeps/x86/Makefile [$(subdir) == elf] (CFLAGS-.os): Removed.
        [$(subdir) == elf] (tests-special): Likewise.
        [$(subdir) == elf] ($(objpfx)tst-ld-sse-use.out): Likewise.
        * sysdeps/x86_64/Makefile [$(subdir) == elf] (CFLAGS-.os): Add
        -mno-mmx for $(all-rtld-routines).

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c229191cffc809ede2574232fd1bef4f03e2c62f

commit c229191cffc809ede2574232fd1bef4f03e2c62f
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sat Jul 11 13:25:25 2015 -0700

    Save and restore vector registers in x86-64 ld.so

    This patch initiaizes GLRO(dl_x86_xstate) in dl_platform_init to
    indicate if the processor supports SSE, AVX or AVX512.  It uses
    this information to properly save and restore vector registers in
    ld.so.  Now we can use SSE in ld.so and delete FOREIGN_CALL macros.
    We can also retire the rtld_must_xmm_save field and remove the
    rtld_savespace_sse field in tcbhead_t.  It is safe since they are
    internal to glibc.

        [BZ #15128]
        * sysdeps/x86_64/Makefile [$(subdir) == elf] (tests): Add
        ifuncmain8.
        (modules-names): Add ifuncmod8.
        ($(objpfx)ifuncmain8): New rule.
        * sysdeps/x86_64/dl-machine.h: Include <dl-procinfo.h> and
        <cpuid.h>.
        (elf_machine_runtime_setup): Use _dl_runtime_resolve_sse,
        _dl_runtime_resolve_avx, or _dl_runtime_resolve_avx512,
        _dl_runtime_profile_sse, _dl_runtime_profile_avx, or
        _dl_runtime_profile_avx512, based on HAS_ARCH_FEATURE.
        * sysdeps/x86_64/dl-trampoline.S: Rewrite.
        * sysdeps/x86_64/dl-trampoline.h: Likewise.
        * sysdeps/x86_64/ifuncmain8.c: New file.
        * sysdeps/x86_64/ifuncmod8.c: Likewise.
        * sysdeps/x86_64/nptl/tcb-offsets.sym (RTLD_SAVESPACE_SSE):
        Removed.
        * sysdeps/x86_64/nptl/tls.h (__128bits): Removed.
        (tcbhead_t): CHange rtld_must_xmm_save to __glibc_unused1.
        Remove rtld_savespace_sse and __padding.
        (RTLD_CHECK_FOREIGN_CALL): Removed.
        (RTLD_ENABLE_FOREIGN_CALL): Likewise.
        (RTLD_PREPARE_FOREIGN_CALL): Likewise.
        (RTLD_FINALIZE_FOREIGN_CALL): Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=bac692ed46c2ff69ac859358b771fd1db6951800

commit bac692ed46c2ff69ac859358b771fd1db6951800
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Jul 12 14:41:20 2015 -0700

    Align stack when calling __errno_location

    We should align stack to 16 bytes when calling __errno_location.

        [BZ #18661]
        * sysdeps/x86_64/fpu/s_cosf.S (__cosf): Align stack to 16 bytes
        when calling __errno_location.
        * sysdeps/x86_64/fpu/s_sincosf.S (__sincosf): Likewise.
        * sysdeps/x86_64/fpu/s_sinf.S (__sinf): Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b9645f91a56d5892a18cb521e195f924292e1367

commit b9645f91a56d5892a18cb521e195f924292e1367
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Jul 12 14:40:25 2015 -0700

    Align stack to 16 bytes when calling __gettimeofday

    Subtract stack by 24 bytes instead of 16 bytes so that stack is aligned
    to 16 bytes when calling __gettimeofday.

        [BZ #18661]
        * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
        (__lll_timedwait_tid): Align stack to 16 bytes when calling
        __gettimeofday.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=46eaabd373ca3f77a46089dc1b79b7ca3f9a4fcd

commit 46eaabd373ca3f77a46089dc1b79b7ca3f9a4fcd
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Jul 12 14:38:58 2015 -0700

    Align stack to 16 bytes when calling __setcontext

    Don't use pop to restore %rdi so that stack is aligned to 16 bytes
    when calling __setcontext.

        [BZ #18661]
        * sysdeps/unix/sysv/linux/x86_64/__start_context.S
        (__start_context): Don't use pop to restore %rdi so that stack
        is aligned to 16 bytes when calling __setcontext.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a00a8b1dd3507d69077fbacd2cb2503f0ba2e462

commit a00a8b1dd3507d69077fbacd2cb2503f0ba2e462
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 29 03:41:58 2015 -0700

    Compile {memcpy,strcmp}-sse2-unaligned.S only for libc

    {memcpy,strcmp}-sse2-unaligned.S aren't needed in ld.so.

        * sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S: Compile
        only for libc.
        * sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8b34a808a30703b60ab9416979a32fa83c4e86e2

commit 8b34a808a30703b60ab9416979a32fa83c4e86e2
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sat Aug 1 07:47:16 2015 -0700

    Update x86 elision-conf.c for <cpu-features.h>

    This patch updates x86 elision-conf.c to use the newly defined
    HAS_CPU_FEATURE from <cpu-features.h>.

        * sysdeps/unix/sysv/linux/x86/elision-conf.c (elision_init):
        Replace HAS_RTM with HAS_CPU_FEATURE (RTM).

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2764863736e437eeba3235a13c58202e269dedbb

commit 2764863736e437eeba3235a13c58202e269dedbb
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Jul 31 16:52:19 2015 -0700

    Update i686 multiarch functions for <cpu-features.h>

    This patch updates i686 multiarch functions to use the newly defined
    HAS_CPU_FEATURE, HAS_ARCH_FEATURE, LOAD_GOT_AND_RTLD_GLOBAL_RO and
    LOAD_FUNC_GOT_EAX from <cpu-features.h>.

        * sysdeps/i386/i686/fpu/multiarch/e_expf.c: Replace HAS_XXX
        with HAS_CPU_FEATURE/HAS_ARCH_FEATURE (XXX).
        * sysdeps/i386/i686/fpu/multiarch/s_cosf.c: Likewise.
        * sysdeps/i386/i686/fpu/multiarch/s_cosf.c: Likewise.
        * sysdeps/i386/i686/fpu/multiarch/s_sincosf.c: Likewise.
        * sysdeps/i386/i686/fpu/multiarch/s_sinf.c: Likewise.
        * sysdeps/i386/i686/multiarch/ifunc-impl-list.c: Likewise.
        * sysdeps/i386/i686/multiarch/s_fma.c: Likewise.
        * sysdeps/i386/i686/multiarch/s_fmaf.c: Likewise.
        * sysdeps/i386/i686/multiarch/bcopy.S: Remove __init_cpu_features
        call.  Merge SHARED and !SHARED.  Add LOAD_GOT_AND_RTLD_GLOBAL_RO.
        Use LOAD_FUNC_GOT_EAX to load function address.  Replace HAS_XXX
        with HAS_CPU_FEATURE/HAS_ARCH_FEATURE (XXX).
        * sysdeps/i386/i686/multiarch/bzero.S: Likewise.
        * sysdeps/i386/i686/multiarch/memchr.S: Likewise.
        * sysdeps/i386/i686/multiarch/memcmp.S: Likewise.
        * sysdeps/i386/i686/multiarch/memcpy.S: Likewise.
        * sysdeps/i386/i686/multiarch/memcpy_chk.S: Likewise.
        * sysdeps/i386/i686/multiarch/memmove.S: Likewise.
        * sysdeps/i386/i686/multiarch/memmove_chk.S: Likewise.
        * sysdeps/i386/i686/multiarch/mempcpy.S: Likewise.
        * sysdeps/i386/i686/multiarch/mempcpy_chk.S: Likewise.
        * sysdeps/i386/i686/multiarch/memrchr.S: Likewise.
        * sysdeps/i386/i686/multiarch/memset.S: Likewise.
        * sysdeps/i386/i686/multiarch/memset_chk.S: Likewise.
        * sysdeps/i386/i686/multiarch/rawmemchr.S: Likewise.
        * sysdeps/i386/i686/multiarch/strcasecmp.S: Likewise.
        * sysdeps/i386/i686/multiarch/strcat.S: Likewise.
        * sysdeps/i386/i686/multiarch/strchr.S: Likewise.
        * sysdeps/i386/i686/multiarch/strcmp.S: Likewise.
        * sysdeps/i386/i686/multiarch/strcpy.S: Likewise.
        * sysdeps/i386/i686/multiarch/strcspn.S: Likewise.
        * sysdeps/i386/i686/multiarch/strlen.S: Likewise.
        * sysdeps/i386/i686/multiarch/strncase.S: Likewise.
        * sysdeps/i386/i686/multiarch/strnlen.S: Likewise.
        * sysdeps/i386/i686/multiarch/strrchr.S: Likewise.
        * sysdeps/i386/i686/multiarch/strspn.S: Likewise.
        * sysdeps/i386/i686/multiarch/wcschr.S: Likewise.
        * sysdeps/i386/i686/multiarch/wcscmp.S: Likewise.
        * sysdeps/i386/i686/multiarch/wcscpy.S: Likewise.
        * sysdeps/i386/i686/multiarch/wcslen.S: Likewise.
        * sysdeps/i386/i686/multiarch/wcsrchr.S: Likewise.
        * sysdeps/i386/i686/multiarch/wmemcmp.S: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b846eb01242c35fa60a30cf7950f0a28d3ac3f62

commit b846eb01242c35fa60a30cf7950f0a28d3ac3f62
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Jul 31 13:41:04 2015 -0700

    Update x86_64 multiarch functions for <cpu-features.h>

    This patch updates x86_64 multiarch functions to use the newly defined
    HAS_CPU_FEATURE, HAS_ARCH_FEATURE and LOAD_RTLD_GLOBAL_RO_RDX from
    <cpu-features.h>.

        * sysdeps/x86_64/fpu/multiarch/e_asin.c: Replace HAS_XXX with
        HAS_CPU_FEATURE/HAS_ARCH_FEATURE (XXX).
        * sysdeps/x86_64/fpu/multiarch/e_atan2.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/e_exp.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/e_log.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/e_pow.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/s_atan.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/s_fma.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/s_fmaf.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/s_sin.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/s_tan.c: Likewise.
        * sysdeps/x86_64/multiarch/ifunc-impl-list.c: Likewise.
        * sysdeps/x86_64/multiarch/sched_cpucount.c: Likewise.
        * sysdeps/x86_64/multiarch/strstr.c: Likewise.
        * sysdeps/x86_64/multiarch/memmove.c: Likewise.
        * sysdeps/x86_64/multiarch/memmove_chk.c: Likewise.
        * sysdeps/x86_64/multiarch/test-multiarch.c: Likewise.
        * sysdeps/x86_64/multiarch/memcmp.S: Remove __init_cpu_features
        call.  Add LOAD_RTLD_GLOBAL_RO_RDX.  Replace HAS_XXX with
        HAS_CPU_FEATURE/HAS_ARCH_FEATURE (XXX).
        * sysdeps/x86_64/multiarch/memcpy.S: Likewise.
        * sysdeps/x86_64/multiarch/memcpy_chk.S: Likewise.
        * sysdeps/x86_64/multiarch/mempcpy.S: Likewise.
        * sysdeps/x86_64/multiarch/mempcpy_chk.S: Likewise.
        * sysdeps/x86_64/multiarch/memset.S: Likewise.
        * sysdeps/x86_64/multiarch/memset_chk.S: Likewise.
        * sysdeps/x86_64/multiarch/strcat.S: Likewise.
        * sysdeps/x86_64/multiarch/strchr.S: Likewise.
        * sysdeps/x86_64/multiarch/strcmp.S: Likewise.
        * sysdeps/x86_64/multiarch/strcpy.S: Likewise.
        * sysdeps/x86_64/multiarch/strcspn.S: Likewise.
        * sysdeps/x86_64/multiarch/strspn.S: Likewise.
        * sysdeps/x86_64/multiarch/wcscpy.S: Likewise.
        * sysdeps/x86_64/multiarch/wmemcmp.S: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=d55078bafe0a30062c6dd2d95811c9949e0fbd3b

commit d55078bafe0a30062c6dd2d95811c9949e0fbd3b
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Jul 31 07:30:04 2015 -0700

    Add _dl_x86_cpu_features to rtld_global in ld.so

    This patch adds _dl_x86_cpu_features to rtld_global in x86 ld.so
    and initializes it early before __libc_start_main is called so that
    cpu_features is always available when it is used and we can avoid
    calling __init_cpu_features in IFUNC selectors.

        * sysdeps/i386/dl-machine.h: Include <cpu-features.c>.
        (dl_platform_init): Call init_cpu_features.
        * sysdeps/i386/dl-procinfo.c (_dl_x86_cpu_features): New.
        * sysdeps/i386/i686/cacheinfo.c
        (DISABLE_PREFERRED_MEMORY_INSTRUCTION): Removed.
        * sysdeps/i386/i686/multiarch/ifunc-defines.sym (KIND_OFFSET):
        Removed.
        * sysdeps/i386/ldsodefs.h: Include <cpu-features.h>.
        * sysdeps/unix/sysv/linux/x86_64/dl-procinfo.c: Include
        <sysdeps/x86_64/dl-procinfo.c> instead of
        sysdeps/generic/dl-procinfo.c>.
        * sysdeps/x86/Makefile [$(subdir) == csu] (gen-as-const-headers):
        Add cpu-features-offsets.sym and rtld-global-offsets.sym.
        * sysdeps/x86/cpu-features-offsets.sym: New file.
        * sysdeps/x86/cpu-features.c: Likewise.
        * sysdeps/x86/cpu-features.h: Likewise.
        * sysdeps/x86/libc-start.c: Likewise.
        * sysdeps/x86/rtld-global-offsets.sym: Likewise.
        * sysdeps/x86_64/dl-procinfo.c: Likewise.
        * sysdeps/x86_64/cacheinfo.c (__cpuid_count): Removed.
        Assume USE_MULTIARCH is defined and don't check it.
        (is_intel): Replace __cpu_features with GLRO(dl_x86_cpu_features).
        (is_amd): Likewise.
        (max_cpuid): Likewise.
        (intel_check_word): Likewise.
        (__cache_sysconf): Don't call __init_cpu_features.
        (__x86_preferred_memory_instruction): Removed.
        (init_cacheinfo): Don't call __init_cpu_features. Replace
        __cpu_features with GLRO(dl_x86_cpu_features).
        * sysdeps/x86_64/dl-machine.h: <cpu-features.c>.
        (dl_platform_init): Call init_cpu_features.
        * sysdeps/x86_64/ldsodefs.h: Include <cpu-features.h>.
        * sysdeps/x86_64/multiarch/cacheinfo.c: Removed.
        * sysdeps/x86_64/multiarch/ifunc-defines.sym (KIND_OFFSET):
        Removed.
        * sysdeps/x86_64/multiarch/init-arch.c: Rewrite.
        * sysdeps/x86_64/multiarch/init-arch.h: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2702b161faaf048300de5c67dad5d1ca2078db60

commit 2702b161faaf048300de5c67dad5d1ca2078db60
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Mar 6 04:55:56 2015 -0800

    Replace __attribute__((visibility("protected")))

    With copy relocation, address of protected data defined in the shared
    library may be external.  Compiler shouldn't asssume protected data will
    be local.  But due to

    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248

    __attribute__((visibility("protected"))) doesn't work correctly, we need
    to use asm (".protected xxx") instead.

    Cherry-pick from master: e0ed2fb40a0e29c43cf60addc74741dab15f2e05
        * elf/ifuncdep2.c (global): Replace
        __attribute__((visibility("protected"))) with
        asm (".protected global").
        * elf/ifuncmod1.c (global): Likewise.
        * elf/ifuncmod5.c (global): Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=d8700f7fa9a60def973ccdfad24266d91d9ce667

commit d8700f7fa9a60def973ccdfad24266d91d9ce667
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Mar 5 11:36:35 2015 -0800

    Add a testcase for copy reloc against protected data

    Linkers in some versions of binutils 2.25 and 2.26 don't support protected
    data symbol with error messsage like:

    /usr/bin/ld: copy reloc against protected `bar' is invalid
    /usr/bin/ld: failed to set dynamic section sizes: Bad value

    We check if linker supports copy reloc against protected data symbol to
    avoid running the test if linker is broken.

    Cherry-pick from master: 83569fb894050db7430047da2219ca50c68f882a
        [BZ #17711]
        * config.make.in (have-protected-data): New.
        * configure.ac: Check linker support for protected data symbol.
        * configure: Regenerated.
        * elf/Makefile (modules-names): Add tst-protected1moda and
        tst-protected1modb if $(have-protected-data) is yes.
        (tests): Add tst-protected1a and tst-protected1b if
        $(have-protected-data) is yes.
        ($(objpfx)tst-protected1a): New.
        ($(objpfx)tst-protected1b): Likewise.
        (tst-protected1modb.so-no-z-defs): Likewise.
        * elf/tst-protected1a.c: New file.
        * elf/tst-protected1b.c: Likewise.
        * elf/tst-protected1mod.h: Likewise.
        * elf/tst-protected1moda.c: Likewise.
        * elf/tst-protected1modb.c: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=eaf2df74329942e92928162faa72159f33f040a7

commit eaf2df74329942e92928162faa72159f33f040a7
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Mar 31 05:15:43 2015 -0700

    Add ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA to x86

    With copy relocation, address of protected data defined in the shared
    library may be external.   When there is a relocation against the
    protected data symbol within the shared library, we need to check if we
    should skip the definition in the executable copied from the protected
    data.  This patch adds ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA and defines
    it for x86.  If ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA isn't 0, do_lookup_x
    will skip the data definition in the executable from copy reloc.

    Cherry-pick from master: 62da1e3b00b51383ffa7efc89d8addda0502e107
        [BZ #17711]
        * elf/dl-lookup.c (do_lookup_x): When UNDEF_MAP is NULL, which
        indicates it is called from do_lookup_x on relocation against
        protected data, skip the data definion in the executable from
        copy reloc.
        (_dl_lookup_symbol_x): Pass ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA,
        instead of ELF_RTYPE_CLASS_PLT, to do_lookup_x for
        EXTERN_PROTECTED_DATA relocation against STT_OBJECT symbol.
        * sysdeps/generic/ldsodefs.h * (ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA):
        New.  Defined to 4 if DL_EXTERN_PROTECTED_DATA is defined,
        otherwise to 0.
        * sysdeps/i386/dl-lookupcfg.h (DL_EXTERN_PROTECTED_DATA): New.
        * sysdeps/i386/dl-machine.h (elf_machine_type_class): Set class
        to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_386_GLOB_DAT.
        * sysdeps/x86_64/dl-lookupcfg.h (DL_EXTERN_PROTECTED_DATA): New.
        * sysdeps/x86_64/dl-machine.h (elf_machine_type_class): Set class
        to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_X86_64_GLOB_DAT.

-----------------------------------------------------------------------

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2015-08-02  3:55 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-14 12:43 [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work hjl.tools at gmail dot com
2014-12-14 15:05 ` Ondřej Bílka
2014-12-14 15:06 ` [Bug dynamic-link/17711] " neleai at seznam dot cz
2014-12-14 15:14 ` hjl.tools at gmail dot com
2014-12-14 20:24 ` hjl.tools at gmail dot com
2014-12-15  0:58 ` hjl.tools at gmail dot com
2014-12-17 16:27 ` hjl.tools at gmail dot com
2014-12-17 21:25 ` hjl.tools at gmail dot com
2015-02-27 21:25 ` hjl.tools at gmail dot com
2015-02-27 22:14 ` cvs-commit at gcc dot gnu.org
2015-02-27 22:16 ` hjl.tools at gmail dot com
2015-03-05 23:20 ` hjl.tools at gmail dot com
2015-03-05 23:50 ` cvs-commit at gcc dot gnu.org
2015-03-06 12:59 ` cvs-commit at gcc dot gnu.org
2015-03-06 13:02 ` cvs-commit at gcc dot gnu.org
2015-03-06 19:39 ` cvs-commit at gcc dot gnu.org
2015-03-06 21:26 ` cvs-commit at gcc dot gnu.org
2015-03-06 22:56 ` hjl.tools at gmail dot com
2015-03-06 23:43 ` cvs-commit at gcc dot gnu.org
2015-03-07  0:59 ` cvs-commit at gcc dot gnu.org
2015-03-07  1:08 ` cvs-commit at gcc dot gnu.org
2015-03-07 14:26 ` cvs-commit at gcc dot gnu.org
2015-03-27 17:21 ` hjl.tools at gmail dot com
2015-03-31 12:17 ` cvs-commit at gcc dot gnu.org
2015-03-31 12:22 ` cvs-commit at gcc dot gnu.org
2015-04-01  0:02 ` cvs-commit at gcc dot gnu.org
2015-04-01  0:05 ` cvs-commit at gcc dot gnu.org
2015-04-01  0:07 ` cvs-commit at gcc dot gnu.org
2015-04-01  0:19 ` cvs-commit at gcc dot gnu.org
2015-04-01  0:28 ` cvs-commit at gcc dot gnu.org
2015-07-11 19:46 ` neleai at seznam dot cz
2015-07-24  9:08 ` cvs-commit at gcc dot gnu.org
2015-08-02  3:55 ` cvs-commit at gcc dot gnu.org

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).