Bug 17709 - [2.26 Regression] elf/vismain test in glibc failed
Summary: [2.26 Regression] elf/vismain test in glibc failed
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.26
: P2 normal
Target Milestone: 2.26
Assignee: Not yet assigned to anyone
URL:
Keywords:
: 19612 (view as bug list)
Depends on:
Blocks: 17711 18636
  Show dependency treegraph
 
Reported: 2014-12-14 12:15 UTC by H.J. Lu
Modified: 2016-02-12 21:01 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2014-12-14 12:15:01 UTC
On Linux/x86-64, I got

/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
Comment 1 H.J. Lu 2014-12-15 00:59:10 UTC
It is related to glibc PR 17711.
Comment 2 cvs-commit@gcc.gnu.org 2015-03-05 14:36:02 UTC
The master branch has been updated by H.J. Lu <hjl@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ca3fe95e469b9daec153caa2c90665f5daaec2b5

commit ca3fe95e469b9daec153caa2c90665f5daaec2b5
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Mar 5 06:34:39 2015 -0800

    Add extern_protected_data and set it for x86
    
    With copy relocation, address of protected data defined in the shared
    library may be external.  This patch adds extern_protected_data and
    changes _bfd_elf_symbol_refs_local_p to return false for protected data
    if extern_protected_data is true.
    
    bfd/
    
    	PR ld/pr15228
    	PR ld/pr17709
    	* elf-bfd.h (elf_backend_data): Add extern_protected_data.
    	* elf32-i386.c (elf_backend_extern_protected_data): New.
    	Defined to 1.
    	* elf64-x86-64.c (elf_backend_extern_protected_data): Likewise.
    	* elflink.c (_bfd_elf_adjust_dynamic_copy): Don't error on
    	copy relocs against protected symbols if extern_protected_data
    	is true.
    	(_bfd_elf_symbol_refs_local_p): Don't return true on protected
    	non-function symbols if extern_protected_data is true.
    	* elfxx-target.h (elf_backend_extern_protected_data): New.
    	Default to 0.
    	(elfNN_bed): Initialize extern_protected_data with
    	elf_backend_extern_protected_data.
    
    ld/testsuite/
    
    	PR ld/pr15228
    	PR ld/pr17709
    	* ld-i386/i386.exp (i386tests): Add a test for PR ld/17709.
    	* ld-i386/pr17709-nacl.rd: New file.
    	* ld-i386/pr17709.rd: Likewise.
    	* ld-i386/pr17709a.s: Likewise.
    	* ld-i386/pr17709b.s: Likewise.
    	* ld-i386/protected3.d: Updated.
    	* ld-i386/protected3.s: Likewise.
    	* ld-x86-64/pr17709-nacl.rd: New file.
    	* ld-x86-64/pr17709.rd: Likewise.
    	* ld-x86-64/pr17709a.s: Likewise.
    	* ld-x86-64/pr17709b.s: Likewise.
    	* ld-x86-64/protected3.d: Updated.
    	* ld-x86-64/protected3.s: Likewise.
    	* ld-x86-64/x86-64.exp (x86_64tests): Add a test for PR ld/17709.
Comment 3 cvs-commit@gcc.gnu.org 2015-03-06 22:54:56 UTC
The binutils-2_25-branch branch has been updated by H.J. Lu <hjl@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=031994d25c8c8dc392ceb43abc2dfd9a851bc384

commit 031994d25c8c8dc392ceb43abc2dfd9a851bc384
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Mar 5 06:34:39 2015 -0800

    Add extern_protected_data and set it for x86
    
    With copy relocation, address of protected data defined in the shared
    library may be external.  This patch adds extern_protected_data and
    changes _bfd_elf_symbol_refs_local_p to return false for protected data
    if extern_protected_data is true.
    
    Backport from master:
    
    bfd/
    
    	PR ld/pr15228
    	PR ld/pr17709
    	* elf-bfd.h (elf_backend_data): Add extern_protected_data.
    	* elf32-i386.c (elf_backend_extern_protected_data): New.
    	Defined to 1.
    	* elf64-x86-64.c (elf_backend_extern_protected_data): Likewise.
    	* elflink.c (_bfd_elf_adjust_dynamic_copy): Don't error on
    	copy relocs against protected symbols if extern_protected_data
    	is true.
    	(_bfd_elf_symbol_refs_local_p): Don't return true on protected
    	non-function symbols if extern_protected_data is true.
    	* elfxx-target.h (elf_backend_extern_protected_data): New.
    	Default to 0.
    	(elfNN_bed): Initialize extern_protected_data with
    	elf_backend_extern_protected_data.
    
    ld/testsuite/
    
    	PR ld/pr15228
    	PR ld/pr17709
    	* ld-i386/i386.exp (i386tests): Add a test for PR ld/17709.
    	* ld-i386/pr17709-nacl.rd: New file.
    	* ld-i386/pr17709.rd: Likewise.
    	* ld-i386/pr17709a.s: Likewise.
    	* ld-i386/pr17709b.s: Likewise.
    	* ld-i386/protected3.d: Updated.
    	* ld-i386/protected3.s: Likewise.
    	* ld-x86-64/pr17709-nacl.rd: New file.
    	* ld-x86-64/pr17709.rd: Likewise.
    	* ld-x86-64/pr17709a.s: Likewise.
    	* ld-x86-64/pr17709b.s: Likewise.
    	* ld-x86-64/protected3.d: Updated.
    	* ld-x86-64/protected3.s: Likewise.
    	* ld-x86-64/x86-64.exp (x86_64tests): Add a test for PR ld/17709.
Comment 4 H.J. Lu 2015-03-06 22:56:03 UTC
Fixed for 2.26.
Comment 5 cvs-commit@gcc.gnu.org 2015-04-10 18:19:20 UTC
The master branch has been updated by H.J. Lu <hjl@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f74839702efcea048ac61374b1539ae81e7c86cc

commit f74839702efcea048ac61374b1539ae81e7c86cc
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Mar 5 06:34:39 2015 -0800

    Add extern_protected_data and set it for x86
    
    Re-apply: commit ca3fe95e469b9daec153caa2c90665f5daaec2b5
    
    With copy relocation, address of protected data defined in the shared
    library may be external.  This patch adds extern_protected_data and
    changes _bfd_elf_symbol_refs_local_p to return false for protected data
    if extern_protected_data is true.
    
    This patch will break building shared libraries with protected data
    symbols using GCCs older than GCC 5 without the bug fix for
    
    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248
    
    GCC backport request should be made in the GCC bug report above.
    
    To get correct run-time behavior on Linux, glibc 2.22 or above are
    required, which have the bug fix for
    
    https://sourceware.org/bugzilla/show_bug.cgi?id=17711
    
    Backports for glibc 2.21, 2.20, 2.19 and 2.18 are on hjl/pr17711/2.21,
    hjl/pr17711/2.20, hjl/pr17711/2.19 and hjl/pr17711/2.18 branches,
    respectively, at
    
    https://sourceware.org/git/?p=glibc.git;a=summary
    
    bfd/
    
    	PR ld/pr15228
    	PR ld/pr17709
    	* elf-bfd.h (elf_backend_data): Add extern_protected_data.
    	* elf32-i386.c (elf_backend_extern_protected_data): New.
    	Defined to 1.
    	* elf64-x86-64.c (elf_backend_extern_protected_data): Likewise.
    	* elflink.c (_bfd_elf_adjust_dynamic_copy): Don't error on
    	copy relocs against protected symbols if extern_protected_data
    	is true.
    	(_bfd_elf_symbol_refs_local_p): Don't return true on protected
    	non-function symbols if extern_protected_data is true.
    	* elfxx-target.h (elf_backend_extern_protected_data): New.
    	Default to 0.
    	(elfNN_bed): Initialize extern_protected_data with
    	elf_backend_extern_protected_data.
    
    ld/testsuite/
    
    	PR ld/pr15228
    	PR ld/pr17709
    	* ld-i386/i386.exp (i386tests): Add a test for PR ld/17709.
    	* ld-i386/pr17709-nacl.rd: New file.
    	* ld-i386/pr17709.rd: Likewise.
    	* ld-i386/pr17709a.s: Likewise.
    	* ld-i386/pr17709b.s: Likewise.
    	* ld-i386/protected3.d: Updated.
    	* ld-i386/protected3.s: Likewise.
    	* ld-x86-64/pr17709-nacl.rd: New file.
    	* ld-x86-64/pr17709.rd: Likewise.
    	* ld-x86-64/pr17709a.s: Likewise.
    	* ld-x86-64/pr17709b.s: Likewise.
    	* ld-x86-64/protected3.d: Updated.
    	* ld-x86-64/protected3.s: Likewise.
    	* ld-x86-64/x86-64.exp (x86_64tests): Add a test for PR ld/17709.
Comment 6 H.J. Lu 2016-02-11 20:28:37 UTC
*** Bug 19612 has been marked as a duplicate of this bug. ***