[Bug ld/22842] Handling of R_X86_64_PC32 in a PIE against a function in a shared library could be better

2018-02-14 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=22842

--- Comment #12 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by H.J. Lu :

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

commit 451875b4f976a527395e9303224c7881b65e12ed
Author: H.J. Lu 
Date:   Wed Feb 14 03:50:40 2018 -0800

x86-64: Use PLT address for PC-relative reloc

Since PLT in PDE and PC-relative PLT in PIE can be used as function
address, there is no need for dynamic PC-relative relocation against
a dynamic function definition in PIE.  Linker should resolve PC-relative
reference to its PLT address.

NB: i386 has non-PIC PLT and PIC PLT.  Only non-PIC PLT in PDE can
be used as function address.  PIC PLT in PIE can't be used as
function address.

bfd/

PR ld/22842
* elf32-i386.c (elf_i386_check_relocs): Pass FALSE for non
PC-relative PLT to NEED_DYNAMIC_RELOCATION_P.
* elf64-x86-64.c (elf_x86_64_check_relocs): Create PLT for
R_X86_64_PC32 reloc against dynamic function in data section.
Pass TRUE for PC-relative PLT to NEED_DYNAMIC_RELOCATION_P.
(elf_x86_64_relocate_section): Use PLT for R_X86_64_PC32 reloc
against dynamic function in data section.
* elfxx-x86.c (elf_x86_allocate_dynrelocs): Use PLT in PIE as
function address only if pcrel_plt is true.
(_bfd_x86_elf_link_hash_table_create): Set pcrel_plt.
* elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): Add PCREL_PLT for
PC-relative PLT.  If PLT is PC-relative, don't generate dynamic
PC-relative relocation against a function definition in data
secton in PIE.  Remove the obsolete comments.
(elf_x86_link_hash_table): Add pcrel_plt.

ld/

PR ld/22842
* testsuite/ld-i386/i386.exp: Run PR ld/22842 tests.
* testsuite/ld-x86-64/x86-64.exp: Likewise.
* testsuite/ld-i386/pr22842a.c: New file.
* testsuite/ld-i386/pr22842b.S: Likewise.
* testsuite/ld-x86-64/pr22842a.c: Likewise.
* testsuite/ld-x86-64/pr22842a.rd: Likewise.
* testsuite/ld-x86-64/pr22842b.S: Likewise.
* testsuite/ld-x86-64/pr22842b.rd: Likewise.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/22842] Handling of R_X86_64_PC32 in a PIE against a function in a shared library could be better

2018-02-14 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22842

H.J. Lu  changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
Version|unspecified |2.31 (HEAD)
 Resolution|--- |FIXED
   Target Milestone|--- |2.31

--- Comment #13 from H.J. Lu  ---
Fixed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/22845] -z separate-code doesn't work right

2018-02-14 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22845

--- Comment #1 from H.J. Lu  ---
Static binary died at:

Program received signal SIGSEGV, Segmentation fault.
__libc_setup_tls () at libc-tls.c:122
122   if (phdr->p_type == PT_TLS)
(gdb) p *phdr
Cannot access memory at address 0x8047034

Program header isn't mapped in:

Elf file type is EXEC (Executable file)
Entry point 0x80487f2
There are 7 program headers, starting at offset 52

Program Headers:
  Type   Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD   0x001000 0x08048000 0x08048000 0x5de08 0x5de08 R E 0x1000
  LOAD   0x05ee08 0x080a6e08 0x080a6e08 0x22f8b 0x22f8b R   0x1000
  LOAD   0x082b80 0x080cbb80 0x080cbb80 0x013d4 0x01fbc RW  0x1000
  NOTE   0x05ee08 0x080a6e08 0x080a6e08 0x00044 0x00044 R   0x4
  TLS0x082b80 0x080cbb80 0x080cbb80 0x00010 0x00030 R   0x4
  GNU_STACK  0x00 0x 0x 0x0 0x0 RW  0x10
  GNU_RELRO  0x082b80 0x080cbb80 0x080cbb80 0x00480 0x00480 R   0x1

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/22845] -z separate-code doesn't work right

2018-02-14 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22845

--- Comment #2 from H.J. Lu  ---
Wrong linker script is used.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/22845] -z separate-code doesn't work right

2018-02-14 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22845

--- Comment #3 from H.J. Lu  ---
With this patch:

https://sourceware.org/ml/binutils/2018-02/msg00212.html

now I got

FAIL: ld-elf/ehdr_start-shared
FAIL: ld-elf/ehdr_start
FAIL: ld-elf/loadaddr1
FAIL: ld-elf/loadaddr2
FAIL: ld-elf/mbind1b
FAIL: ld-elf/mbind1c
FAIL: ld-elf/orphan-region
FAIL: ld-elf/pie
FAIL: ld-elf/pr19162
FAIL: ld-elf/pr22393-1c
FAIL: ld-elf/pr22393-1d
FAIL: ld-elf/pr22423
FAIL: ld-elf/textaddr1
FAIL: ld-elf/textaddr2
FAIL: ld-elf/textaddr4
FAIL: ld-elf/textaddr6
FAIL: PIE preinit array
FAIL: PIE init array
FAIL: PIE fini array
FAIL: PIE init array mixed
FAIL: PIE PR ld/14525
FAIL: Run mbind2b
FAIL: static preinit array
FAIL: static init array
FAIL: static fini array
FAIL: static init array mixed
FAIL: Run indirect5 3
FAIL: Run indirect5 4
FAIL: Run indirect6 3
FAIL: Run indirect6 4
FAIL: indirect5c dynsym
FAIL: indirect5d dynsym
FAIL: indirect6c dynsym
FAIL: indirect6d dynsym
FAIL: Build pr22393-2 (PIE)
FAIL: Run pr18458 with PIE
FAIL: Run pr2404 with PIE
FAIL: Run pr2404 with PIE (-z now)
FAIL: Run pr18718 with PIE (1)
FAIL: Run pr18718 with PIE (3)
FAIL: Run pr18718 with PIC (2)
FAIL: Run pr18718 with PIC (4)
FAIL: Run pr19579
FAIL: Run pr19579 (-z now)
FAIL: Run pr22393-2 (PIE)
FAIL: Run pr22393-2 (static)
FAIL: Run pr19719pie fun defined
FAIL: Build pr22263-1
FAIL: TLS -fpic -shared transitions
FAIL: TLS -fpic -shared transitions without PLT
FAIL: TLS descriptor -fpic -shared transitions
FAIL: TLS -fpic and -fno-pic exec transitions
FAIL: TLS -fpic and -fno-pic exec transitions without PLT
FAIL: TLS descriptor -fpic and -fno-pic exec transitions
FAIL: TLS -fno-pic -shared
FAIL: TLS with global dynamic and descriptors
FAIL: Basic --emit-relocs support
FAIL: Build pr19827
FAIL: ld-i386/protected5
FAIL: TLS with PIE
FAIL: TLS with PIE
FAIL: ld-i386/tlspie3a
FAIL: ld-i386/tlspie3b
FAIL: ld-i386/tlspie3c
FAIL: ld-i386/nogot2
FAIL: ld-i386/lea1b
FAIL: ld-i386/lea1e
FAIL: ld-i386/mov2b
FAIL: ld-i386/load1
FAIL: ld-i386/pr19615
FAIL: ld-i386/pr19636-1a
FAIL: ld-i386/pr19636-1b
FAIL: ld-i386/pr19636-1j
FAIL: ld-i386/pr19636-1k
FAIL: ld-i386/pr19636-2a
FAIL: ld-i386/pr19636-2b
FAIL: ld-i386/pr19636-2c
FAIL: ld-i386/pr19636-3a
FAIL: ld-i386/pr19636-3b
FAIL: ld-i386/pr19636-3c
FAIL: ld-i386/pr19636-3h
FAIL: ld-i386/pr19636-3i
FAIL: ld-i386/pr19636-4a
FAIL: ld-i386/pr19636-4b
FAIL: ld-i386/pr19609-2b
FAIL: ld-i386/undefweakb
FAIL: ld-i386/pr20244-1a
FAIL: ld-i386/pr20244-1b
FAIL: ld-i386/pr20244-1c
FAIL: ld-i386/pr20244-2a
FAIL: ld-i386/pr20244-2b
FAIL: ld-i386/pr20244-2c
FAIL: ld-i386/pr20244-2d
FAIL: ld-i386/pr20244-4a
FAIL: ld-i386/pr20244-4b
FAIL: ld-i386/pr20244-4c
FAIL: ld-i386/pr20253-4b
FAIL: ld-i386/pie1
FAIL: ld-i386/pr22115-1a
FAIL: ld-i386/pr22115-1b
FAIL: ld-i386/pr22135
FAIL: PR ld/13302
FAIL: basic PLT generation (non-PIC, -z now)
FAIL: PR ld/20830 (.plt.got)
FAIL: ld-i386/ibt-plt-1
FAIL: ld-i386/ibt-plt-2a
FAIL: ld-i386/ibt-plt-2b
FAIL: ld-i386/ibt-plt-2c
FAIL: ld-i386/ibt-plt-2d
FAIL: ld-i386/ibt-plt-3a
FAIL: ld-i386/ibt-plt-3b
FAIL: ld-i386/ibt-plt-3c
FAIL: ld-i386/ibt-plt-3d
FAIL: Common symbol override ifunc test 1a
FAIL: Common symbol override ifunc test 1b
FAIL: ld-ifunc/ifunc-1-local-x86
FAIL: ld-ifunc/ifunc-1-x86
FAIL: ld-ifunc/ifunc-2-i386-now
FAIL: ld-ifunc/ifunc-2-local-i386-now
FAIL: ld-ifunc/ifunc-2-local-x86-64-now
FAIL: ld-ifunc/ifunc-2-local-x86-64
FAIL: ld-ifunc/ifunc-2-x86-64-now
FAIL: ld-ifunc/ifunc-2-x86-64
FAIL: ld-ifunc/ifunc-21-i386
FAIL: ld-ifunc/ifunc-21-x86-64
FAIL: ld-ifunc/ifunc-22-i386
FAIL: ld-ifunc/ifunc-22-x86-64
FAIL: ld-ifunc/ifunc-23b-x86
FAIL: ld-ifunc/ifunc-24b-x86
FAIL: ld-ifunc/ifunc-25b-x86
FAIL: ld-ifunc/ifunc-3a-x86
FAIL: ld-ifunc/pr17154-i386-now
FAIL: ld-ifunc/pr17154-i386
FAIL: ld-ifunc/pr17154-x86-64-now
FAIL: ld-ifunc/pr17154-x86-64
FAIL: Run ifunc-main with PIE (-z now)
FAIL: weak undefined
FAIL: weak undefined data
FAIL: missing entry symbol
FAIL: zero p_vaddr
FAIL: weak undefined functions in pie, no dyn undef weak
FAIL: weak undefined functions in pie, dyn undef weak
FAIL: Build mpx4
FAIL: Build mpx3 (-z now)
FAIL: Build mpx4 (-z now)
FAIL: Run mpx1 with -static
FAIL: Run mpx2
FAIL: Run mpx2 with -static
FAIL: ld-x86-64/bnd-ifunc-1
FAIL: ld-x86-64/bnd-ifunc-2
FAIL: ld-x86-64/bnd-plt-1
FAIL: ld-x86-64/bnd-branch-1-now
FAIL: ld-x86-64/bnd-ifunc-1-now
FAIL: ld-x86-64/bnd-ifunc-2-now
FAIL: ld-x86-64/bnd-plt-1-now
FAIL: No PLT (PIE 1e)
FAIL: No PLT (PIE 1f)
FAIL: No PLT (PIE 1g)
FAIL: No PLT (static 1d)
FAIL: No PLT (PIE 1e)
FAIL: No PLT (PIE 1f)
FAIL: No PLT (PIE 1g)
FAIL: Run pr20253-2b
FAIL: Run pr20253-2c
FAIL: Run pr20253-2e
FAIL: Run pr20253-2g
FAIL: TLS GD/LD -> LE transition without PLT (PIE)
FAIL: TLS GD/LD -> LE transition without PLT (PIE, -z now)
FAIL: TLS GD/LD -> LE transition without PLT (static)
FAIL: Run tlsdesc1 with PIE
FAIL: Run tlsdesc1 with PIE (-z now)
FAIL: TLS -fpic -shared transitions
FAIL: TLS -fpic -shared transitions with r15 as GOT base
FAIL: TLS de

[Bug ld/13671] gld creates i386 relocations not supported by Solaris ld.so.1

2018-02-14 Thread ro at CeBiTec dot Uni-Bielefeld.DE
https://sourceware.org/bugzilla/show_bug.cgi?id=13671

--- Comment #18 from Rainer Orth  ---
> --- Comment #17 from H.J. Lu  ---
> Please try users/hjl/solaris branch at
>
> https://github.com/hjl-tools/binutils-gdb

Any reason not to keep that branch in the binutils-git repo on
sourceware?  That's where I looked initially, confusing the hell out of
me ;-)

Fortunately, a lot of failures are gone, but still a couple remain, all
from g++.dg/tree-prof and gcc.dg/tree-prof tests, which SEGV, e.g.

FAIL: gcc.dg/tree-prof/crossmodule-indircall-1.c execution,   
-fprofile-generate -D_PROFILE_GENERATE

Thread 2 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1 (LWP 1)]
0x080491c9 in __gcov_indirect_call_profiler_v2 (value=151663852, 
cur_func=0x8048f10 )
at /vol/gcc/src/hg/trunk/local/libgcc/libgcov-profiler.c:335
335   if (cur_func == __gcov_indirect_call_callee
=> 0x8049019 <__gcov_indirect_call_profiler_v2+41>: cmp%edx,(%eax)
(gdb) p/x $eax
$1 = 0x66caa44

That address is indeed unmapped and below the text segment.

(gdb) where
#0  0x080491c9 in __gcov_indirect_call_profiler_v2 (value=151663852, 
cur_func=0x8048f10 )
at /vol/gcc/src/hg/trunk/local/libgcc/libgcov-profiler.c:335
#1  0x08048f41 in add ()
#2  0x08048e5c in main ()

elfdump -r complains about the executable:

crossmodule-indircall-1.x01: bad relocation entry: R_386_TLS_TPOFF: relocation
requires symbol
crossmodule-indircall-1.x01: bad relocation entry: R_386_TLS_TPOFF: relocation
requires symbol

[3]  R_386_TLS_TPOFF  0x804d22c   0x4  .got
[4]  R_386_TLS_TPOFF  0x804d230 0  .got
   [11]  R_386_JMP_SLOT   0x804d1c8 0x80489f6  .got___tls_get_addr

It happens even when I build without -flto:

$ ld -m elf_i386_sol2 -o crossmodule-indircall-1.x01 /usr/lib/crt1.o
crossmodule-indircall-1.o crossmodule-indircall-1a.o -lm -lgcov -lgcc -lc
/usr/lib/crtn.o

Input files at

   
https://www.cebitec.uni-bielefeld.de/~ro/files/crossmodule-indircall-1.tar.bz2

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/13671] gld creates i386 relocations not supported by Solaris ld.so.1

2018-02-14 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=13671

--- Comment #19 from H.J. Lu  ---
(In reply to Rainer Orth from comment #18)
> > --- Comment #17 from H.J. Lu  ---
> > Please try users/hjl/solaris branch at
> >
> > https://github.com/hjl-tools/binutils-gdb
> 
> Any reason not to keep that branch in the binutils-git repo on
> sourceware?  That's where I looked initially, confusing the hell out of
> me ;-)

It is easier to update a branch on github.

> Fortunately, a lot of failures are gone, but still a couple remain, all
> from g++.dg/tree-prof and gcc.dg/tree-prof tests, which SEGV, e.g.
> 
> FAIL: gcc.dg/tree-prof/crossmodule-indircall-1.c execution,   
> -fprofile-generate -D_PROFILE_GENERATE
> 
> Thread 2 received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 1 (LWP 1)]
> 0x080491c9 in __gcov_indirect_call_profiler_v2 (value=151663852, 
> cur_func=0x8048f10 )
> at /vol/gcc/src/hg/trunk/local/libgcc/libgcov-profiler.c:335
> 335   if (cur_func == __gcov_indirect_call_callee
> => 0x8049019 <__gcov_indirect_call_profiler_v2+41>: cmp%edx,(%eax)
> (gdb) p/x $eax
> $1 = 0x66caa44
> 
> That address is indeed unmapped and below the text segment.
> 
> (gdb) where
> #0  0x080491c9 in __gcov_indirect_call_profiler_v2 (value=151663852, 
> cur_func=0x8048f10 )
> at /vol/gcc/src/hg/trunk/local/libgcc/libgcov-profiler.c:335
> #1  0x08048f41 in add ()
> #2  0x08048e5c in main ()
> 
> elfdump -r complains about the executable:
> 
> crossmodule-indircall-1.x01: bad relocation entry: R_386_TLS_TPOFF:
> relocation requires symbol
> crossmodule-indircall-1.x01: bad relocation entry: R_386_TLS_TPOFF:
> relocation requires symbol

What doe Solaris ld generate?

> [3]  R_386_TLS_TPOFF  0x804d22c   0x4  .got
> [4]  R_386_TLS_TPOFF  0x804d230 0  .got
>[11]  R_386_JMP_SLOT   0x804d1c8 0x80489f6  .got___tls_get_addr
> 
> It happens even when I build without -flto:
> 
> $ ld -m elf_i386_sol2 -o crossmodule-indircall-1.x01 /usr/lib/crt1.o
> crossmodule-indircall-1.o crossmodule-indircall-1a.o -lm -lgcov -lgcc -lc
> /usr/lib/crtn.o
> 
> Input files at
> 
>   
> https://www.cebitec.uni-bielefeld.de/~ro/files/crossmodule-indircall-1.tar.
> bz2

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/13671] gld creates i386 relocations not supported by Solaris ld.so.1

2018-02-14 Thread ro at CeBiTec dot Uni-Bielefeld.DE
https://sourceware.org/bugzilla/show_bug.cgi?id=13671

--- Comment #20 from Rainer Orth  ---
> --- Comment #19 from H.J. Lu  ---
[...]

> What doe Solaris ld generate?

Here are the initial sections of with either linker:

* gas-gld:

08048ff0 <__gcov_indirect_call_profiler_v2>:
 8048ff0:   55  push   %ebp
 8048ff1:   89 e5   mov%esp,%ebp
 8048ff3:   57  push   %edi
 8048ff4:   56  push   %esi
 8048ff5:   53  push   %ebx
 8048ff6:   e8 8d ff ff ff  call   8048f88 <__x86.get_pc_thunk.bx>
 8048ffb:   81 c3 99 3f 00 00   add$0x3f99,%ebx
 8049001:   83 ec 1csub$0x1c,%esp
 8049004:   8b 7d 08mov0x8(%ebp),%edi
 8049007:   8b 75 0cmov0xc(%ebp),%esi
 804900a:   65 a1 00 00 00 00   mov%gs:0x0,%eax
 8049010:   03 83 8c 00 00 00   add0x8c(%ebx),%eax
 8049016:   8b 55 10mov0x10(%ebp),%edx
 8049019:   39 10   cmp%edx,(%eax)

* gas-ld:

08052230 <__gcov_indirect_call_profiler_v2>:
 8052230:   55  push   %ebp
 8052231:   89 e5   mov%esp,%ebp
 8052233:   57  push   %edi
 8052234:   56  push   %esi
 8052235:   53  push   %ebx
 8052236:   e8 6e fb ff ff  call   8051da9 <__x86.get_pc_thunk.bx>
 805223b:   81 c3 4d 2b 01 00   add$0x12b4d,%ebx
 8052241:   83 ec 1csub$0x1c,%esp
 8052244:   8b 7d 08mov0x8(%ebp),%edi
 8052247:   8b 75 0cmov0xc(%ebp),%esi
 805224a:   65 a1 00 00 00 00   mov%gs:0x0,%eax
 8052250:   05 fc ff ff ff  add$0xfffc,%eax
 8052255:   90  nop
 8052256:   8b 55 10mov0x10(%ebp),%edx
 8052259:   39 10   cmp%edx,(%eax)

The full executable is at

   
https://www.cebitec.uni-bielefeld.de/~ro/files/crossmodule-indircall-1-ld.tar.bz2

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22823] bfd/libbfd.h:268:4: error: cast between incompatible function types from ‘bfd_boolean (*)(bfd *)’ {aka ‘int (*)(struct bfd *)’} to ‘bfd_boolean (*)(bfd *, bfd *)’ {aka ‘int (*)(st

2018-02-14 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=22823

--- Comment #6 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Nick Clifton :

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

commit 12ef3f5a7c5a6b89964842fd3da047b8d07dec91
Author: Nick Clifton 
Date:   Wed Feb 14 14:56:21 2018 +

Fix compilation of the BFD sub-directory with a gcc v8 compiler by adding
extra casts.

GCC v8 issues warnings about mis-matching casts of function pointers.
A previous patch tried to fix this problem by adding new dummy functions
which accepted a variable number of arguments.  But this introduces serious
problems when compiled with other versions of gcc, (notably gcc 4.4).  This
patch reverts that previous solution and instead adds extra casts (to
function types without a parameter list).

For more details see:
https://sourceware.org/ml/binutils/2018-02/msg00198.html

PR 22823
Revert previous delta.  Add extra casts to avoid compile time
warnings instead.
* libbfd-in.h (_bfd_generic_bfd_copy_private_bfd_data): Add extra
cast to avoid warning from gcc v8 compiler.
(_bfd_generic_bfd_merge_private_bfd_data): Likewise.
(_bfd_generic_bfd_set_private_flags): Likewise.
(_bfd_generic_bfd_copy_private_section_data): Likewise.
(_bfd_generic_bfd_copy_private_symbol_data): Likewise.
(_bfd_generic_bfd_copy_private_header_data): Likewise.
(_bfd_generic_bfd_print_private_bfd_data): Likewise.
(_bfd_noarchive_construct_extended_name_table): Likewise.
(_bfd_noarchive_truncate_arname): Likewise.
(_bfd_noarchive_write_ar_hdr): Likewise.
(_bfd_noarchive_get_elt_at_index): Likewise.
(_bfd_nosymbols_canonicalize_symtab): Likewise.
(_bfd_nosymbols_print_symbol): Likewise.
(_bfd_nosymbols_get_symbol_info): Likewise.
(_bfd_nosymbols_get_symbol_version_string): Likewise.
(_bfd_nosymbols_bfd_is_local_label_name): Likewise.
(_bfd_nosymbols_bfd_is_target_special_symbol): Likewise.
(_bfd_nosymbols_get_lineno): Likewise.
(_bfd_nosymbols_find_nearest_line): Likewise.
(_bfd_nosymbols_find_line): Likewise.
(_bfd_nosymbols_find_inliner_info): Likewise.
(_bfd_nosymbols_bfd_make_debug_symbol): Likewise.
(_bfd_nosymbols_read_minisymbols): Likewise.
(_bfd_nosymbols_minisymbol_to_symbol): Likewise.
(_bfd_norelocs_bfd_reloc_type_lookup): Likewise.
(_bfd_norelocs_bfd_reloc_name_lookup): Likewise.
(_bfd_nowrite_set_arch_mach): Likewise.
(_bfd_nowrite_set_section_contents): Likewise.
(_bfd_nolink_sizeof_headers): Likewise.
(_bfd_nolink_bfd_get_relocated_section_contents): Likewise.
(_bfd_nolink_bfd_relax_section): Likewise.
(_bfd_nolink_bfd_gc_sections): Likewise.
(_bfd_nolink_bfd_lookup_section_flags): Likewise.
(_bfd_nolink_bfd_merge_sections): Likewise.
(_bfd_nolink_bfd_is_group_section): Likewise.
(_bfd_nolink_bfd_discard_group): Likewise.
(_bfd_nolink_bfd_link_hash_table_create): Likewise.
(_bfd_nolink_bfd_link_add_symbols): Likewise.
(_bfd_nolink_bfd_link_just_syms): Likewise.
(_bfd_nolink_bfd_copy_link_hash_symbol_type): Likewise.
(_bfd_nolink_bfd_final_link): Likewise.
(_bfd_nolink_bfd_link_split_section): Likewise.
(_bfd_nolink_section_already_linked): Likewise.
(_bfd_nolink_bfd_define_common_symbol): Likewise.
(_bfd_nolink_bfd_define_start_stop): Likewise.
(_bfd_nodynamic_canonicalize_dynamic_symtab): Likewise.
(_bfd_nodynamic_get_synthetic_symtab): Likewise.
(_bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_): Likewise.
(_bfd_nodynamic_canonicalize_dynamic_reloc): Likewise.
* libbfd.c (bfd_false_any): Delete.
(bfd_true_any, bfd_nullvoidptr_any, bfd_0_any): Delete.
(bfd_0u_any, bfd_0l_any, _bfd_n1_any, bfd_void_any): Delete.
* libbfd.h (extern): Regenerate
* aout-target.h (MY_bfd_is_target_special_symbol): Add extra
cast to avoid warning from gcc v8 compiler.
* aout-tic30.c (tic30_aout_set_arch_mach): Likewise.
* binary.c (binary_get_symbol_info): Likewise.
* coff-alpha.c (alpha_ecoff_backend_data): Likewise.
* coff-mips.c (mips_ecoff_backend_data): Likewise.
* coffcode.h (coff_set_alignment_hook): Likewise.
(symname_in_debug_hook): Likewise.
(bfd_coff_backend_data bigobj_swap_table): Likewise.
* elf-m10300.c (elf_backend_omit_section_dynsym): Likewise.
* elf32-cr16.c (elf_backend_omit_section_dynsym): Likewise.
* elf32-lm32.c (elf_backend_omit_section_dynsym): Likewise.
* elf32-m32r.c (elf_backend_omit_section_dynsym): Likewise.
* elf32-metag.c (elf_backend_omit_section_dynsym): Li

[Bug ld/22758] FAIL: Run pr22393-2

2018-02-14 Thread romain.geissler at amadeus dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22758

Romain Geissler  changed:

   What|Removed |Added

 CC||romain.geissler at amadeus dot 
com

--- Comment #7 from Romain Geissler  ---
Hi,

Long story short, I was trying to build clang in PGO+LTO bootstrap mode the
last few days, and the bootstrap fails with a segfault at the moment clang is
ran on the profiling data set.

I hunted down the issue to the fact that in some LLVM libraries, "atexit"
function is inlined and included in the loaded shared libraries, but placed in
a section that ld.so mapped in a RW segment rather than a RE segment, and both
segment are not correctly aligned to the boundary of a 2MB page like it should.

When applying this patch, the bootstrap of clang works. Given that this might
potentially happen arbitrarily to any user of binutils 2.30 and it is not so
easy to understand that section placement is wrong here, would you please
backport this to the 2.30 branch ?

Thanks,
Romain

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/13671] gld creates i386 relocations not supported by Solaris ld.so.1

2018-02-14 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=13671

--- Comment #21 from H.J. Lu  ---
(In reply to Rainer Orth from comment #20)

> The full executable is at
> 
>   
> https://www.cebitec.uni-bielefeld.de/~ro/files/crossmodule-indircall-1-ld.
> tar.bz2

I didn't see R_386_TLS_TPOFF.  What happened to

0030  0b12 R_386_TLS_GD   0004  
__gcov_indirect_call_callee

in input file?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/22846] New: i686-w64-mingw32 cross linker generates truncated binary image

2018-02-14 Thread despair at rvx86 dot net
https://sourceware.org/bugzilla/show_bug.cgi?id=22846

Bug ID: 22846
   Summary: i686-w64-mingw32 cross linker generates truncated
binary image
   Product: binutils
   Version: 2.30
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: ld
  Assignee: unassigned at sourceware dot org
  Reporter: despair at rvx86 dot net
  Target Milestone: ---

Using the cross-linker with any set of object files results in the following
repeated message, emitting a truncated binary image that is corrupt:

DJ: zero vma section reloc detected: `.text' #0 f=283

Host:
[despair@ntdev1 ~]$ uname -a
OpenBSD ntdev1.rvx86.net 6.2 GENERIC.MP#5 amd64

Target: i686-w64-mingw32 shared library (.dll)
Built binutils from straight from the tarball, nothing fancy.

Steps to reproduce:
1. Build binutils 2.30 for i686-w64-mingw32.
2. Build GCC or Clang for the same target.
3. Compile and link any shared library target, even the most minimal:

#include 

BOOL FAR PASCAL DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved
)
{
// Perform actions based on the reason for calling.
switch( fdwReason )
{
case DLL_PROCESS_ATTACH:
// Initialize once for each new process.
// Return FALSE to fail DLL load.
break;

case DLL_THREAD_ATTACH:
// Do thread-specific initialization.
break;

case DLL_THREAD_DETACH:
// Do thread-specific cleanup.
break;

case DLL_PROCESS_DETACH:
// Perform any necessary cleanup.
break;
}
return TRUE;  // Successful DLL_PROCESS_ATTACH.
}

Attempting to link produces the above message.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/22846] i686-w64-mingw32 cross linker generates truncated binary image

2018-02-14 Thread despair at rvx86 dot net
https://sourceware.org/bugzilla/show_bug.cgi?id=22846

Absolute Despair  changed:

   What|Removed |Added

 Target||i686-w64-mingw32
   Host||x86_64-unknown-openbsd6.2
  Build||x86_64-unknown-openbsd6.2

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils