[Bug gas/21661] .symver shouldn't be allowed on common symbol

2017-06-26 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=21661

--- Comment #2 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=a3aea05a66ec325ddd19b0c8dbe504958a295cd3

commit a3aea05a66ec325ddd19b0c8dbe504958a295cd3
Author: H.J. Lu 
Date:   Mon Jun 26 05:11:07 2017 -0700

Check unsupported .symver with common symbol

The .symver directive on common symbol creates a new common symbol,
which shouldn't be allowed, similar to alias on common symbol:

$ cat y.S
.comm   bar,8,8
 .set bar1,bar
$ as -o y.o y.S
y.S: Assembler messages:
y.S:2: Error: `bar1' can't be equated to common symbol 'bar'
$

PR gas/21661
* config/obj-elf.c (obj_elf_symver): Don't allow .symver with
common symbol.
(elf_frob_symbol): Likewise.
* testsuite/gas/elf/elf.exp: Run pr21661.
* testsuite/gas/elf/pr21661.d: New file.
* testsuite/gas/elf/pr21661.s: 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 gas/21661] .symver shouldn't be allowed on common symbol

2017-06-26 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21661

H.J. Lu  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |2.29

--- Comment #3 from H.J. Lu  ---
Fixed for 2.29.

-- 
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/21659] strings behaviour when called on a directory

2017-06-26 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=21659

--- Comment #4 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=0602cdad745472ed2561d8096a4bb021c8d0301d

commit 0602cdad745472ed2561d8096a4bb021c8d0301d
Author: Nick Clifton 
Date:   Mon Jun 26 13:25:41 2017 +0100

Produce a consistent warning message when attempting to run a tool on a
directory.

PR binutils/21659
* bucomm.c (get_file_size): Explicitly warn if the file is a
directory.

-- 
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 gold/21674] New: Gold fails properly build glibc

2017-06-26 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21674

Bug ID: 21674
   Summary: Gold fails properly build glibc
   Product: binutils
   Version: 2.29 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: gold
  Assignee: ccoutant at gmail dot com
  Reporter: hjl.tools at gmail dot com
CC: ian at airs dot com
  Target Milestone: ---

hjl/pr14995 branch:

https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/hjl/pr14995

allows gold to be used to build glibc.  For "make check" on x86-64, I got

Error in `/export/build/gnu/glibc-gold/build-x86_64-linux/elf/constload1':
double free or corruption (fasttop): 0x008755f0 ***
=== Backtrace: =
/export/build/gnu/glibc-gold/build-x86_64-linux/libc.so.6(+0x772fb)[0x7f85225b52fb]
/export/build/gnu/glibc-gold/build-x86_64-linux/libc.so.6(+0x7d6c6)[0x7f85225bb6c6]
/export/build/gnu/glibc-gold/build-x86_64-linux/libc.so.6(+0x7df0e)[0x7f85225bbf0e]
/export/build/gnu/glibc-gold/build-x86_64-linux/dlfcn/libdl.so.2(+0x182d)[0x7f85226e682d]
/export/build/gnu/glibc-gold/build-x86_64-linux/dlfcn/libdl.so.2(dlclose+0x1f)[0x7f85226e623f]
/export/build/gnu/glibc-gold/build-x86_64-linux/elf/constload2.so(+0x933)[0x7f8522539933]
/export/build/gnu/glibc-gold/build-x86_64-linux/elf/ld.so(+0xfd1a)[0x7f85226fbd1a]
/export/build/gnu/glibc-gold/build-x86_64-linux/libc.so.6(+0x3c5e0)[0x7f852257a5e0]
/export/build/gnu/glibc-gold/build-x86_64-linux/libc.so.6(+0x3c63a)[0x7f852257a63a]
/export/build/gnu/glibc-gold/build-x86_64-linux/elf/constload2.so(+0x9aa)[0x7f85225399aa]
/export/build/gnu/glibc-gold/build-x86_64-linux/elf/ld.so(+0xf74a)[0x7f85226fb74a]
/export/build/gnu/glibc-gold/build-x86_64-linux/elf/ld.so(+0xf85b)[0x7f85226fb85b]
/export/build/gnu/glibc-gold/build-x86_64-linux/elf/ld.so(+0x13e98)[0x7f85226ffe98]
/export/build/gnu/glibc-gold/build-x86_64-linux/libc.so.6(_dl_catch_error+0x71)[0x7f85226643c1]
/export/build/gnu/glibc-gold/build-x86_64-linux/elf/ld.so(+0x13639)[0x7f85226ff639]
/export/build/gnu/glibc-gold/build-x86_64-linux/dlfcn/libdl.so.2(+0x1156)[0x7f85226e6156]
/export/build/gnu/glibc-gold/build-x86_64-linux/libc.so.6(_dl_catch_error+0x71)[0x7f85226643c1]
/export/build/gnu/glibc-gold/build-x86_64-linux/dlfcn/libdl.so.2(+0x1789)[0x7f85226e6789]
/export/build/gnu/glibc-gold/build-x86_64-linux/dlfcn/libdl.so.2(dlopen+0x32)[0x7f85226e61e2]
/export/build/gnu/glibc-gold/build-x86_64-linux/elf/constload1[0x4009ca]
/export/build/gnu/glibc-gold/build-x86_64-linux/libc.so.6(__libc_start_main+0xf1)[0x7f8522565231]
/export/build/gnu/glibc-gold/build-x86_64-linux/elf/constload1[0x400a5a]
=== Memory map: 
0040-00401000 r-xp  08:11 26334965  
/export/build/gnu/glibc-gold/build-x86_64-linux/elf/constload1
00401000-00402000 r--p  08:11 26334965  
/export/build/gnu/glibc-gold/build-x86_64-linux/elf/constload1
00402000-00403000 rw-p 1000 08:11 26334965  
/export/build/gnu/glibc-gold/build-x86_64-linux/elf/constload1
00875000-00896000 rw-p  00:00 0  [heap]
7f851c00-7f851c021000 rw-p  00:00 0
7f851c021000-7f852000 ---p  00:00 0
7f85222f3000-7f8522309000 r-xp  08:02 136658
/usr/lib64/libgcc_s-6.3.1-20170216.so.1
7f8522309000-7f8522508000 ---p 00016000 08:02 136658
/usr/lib64/libgcc_s-6.3.1-20170216.so.1
7f8522508000-7f8522509000 r--p 00015000 08:02 136658
/usr/lib64/libgcc_s-6.3.1-20170216.so.1
7f8522509000-7f852250a000 rw-p 00016000 08:02 136658
/usr/lib64/libgcc_s-6.3.1-20170216.so.1
7f8522539000-7f852253a000 r-xp  08:11 26334619  
/export/build/gnu/glibc-gold/build-x86_64-linux/elf/constload2.so
7f852253a000-7f852253b000 r--p  08:11 26334619  
/export/build/gnu/glibc-gold/build-x86_64-linux/elf/constload2.so
7f852253b000-7f852253c000 rw-p 1000 08:11 26334619  
/export/build/gnu/glibc-gold/build-x86_64-linux/elf/constload2.so
7f852253c000-7f852253e000 rw-p  00:00 0
7f852253e000-7f85226da000 r-xp  08:11 26309973  
/export/build/gnu/glibc-gold/build-x86_64-linux/libc.so
7f85226da000-7f85226db000 ---p 0019c000 08:11 26309973  
/export/build/gnu/glibc-gold/build-x86_64-linux/libc.so
7f85226db000-7f85226de000 r--p 0019c000 08:11 26309973  
/export/build/gnu/glibc-gold/build-x86_64-linux/libc.so
7f85226de000-7f85226e1000 rw-p 0019f000 08:11 26309973  
/export/build/gnu/glibc-gold/build-x86_64-linux/libc.so
7f85226e1000-7f85226e5000 rw-p  00:00 0
7f85226e5000-7f85226e8000 r-xp  08:11 26313777  
/export/build/gnu/glibc-gold/build-x86_64-linux/dlfcn/libdl.so
7f85226e8000-7f85226e9000 r--p 2000 08:11 26313777   

[Bug gold/21674] gold: "make check" failures in glibc

2017-06-26 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21674

H.J. Lu  changed:

   What|Removed |Added

 Target||x86-64
Summary|Gold fails properly build   |gold: "make check" failures
   |glibc   |in glibc

-- 
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 gold/21674] gold: "make check" failures in glibc

2017-06-26 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21674

H.J. Lu  changed:

   What|Removed |Added

 Target|x86-64  |x86-64, i386

-- 
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 gold/21674] gold: "make check" failures in glibc

2017-06-26 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21674

--- Comment #1 from H.J. Lu  ---
On i686, I got

FAIL: dlfcn/bug-dl-leaf
FAIL: elf/check-abi-ld
FAIL: elf/check-abi-libc
FAIL: elf/constload1
FAIL: elf/global
FAIL: elf/ifuncmain1
FAIL: elf/ifuncmain1pic
FAIL: elf/ifuncmain1pie
FAIL: elf/ifuncmain1vis
FAIL: elf/ifuncmain1vispic
FAIL: elf/ifuncmain1vispie
FAIL: elf/ifuncmain3
FAIL: elf/initfirst
FAIL: elf/preloadtest
FAIL: elf/tst-audit11
FAIL: elf/tst-audit12
FAIL: elf/tst-dlmodcount
FAIL: elf/tst-dlmopen1
FAIL: elf/tst-dlmopen3
FAIL: elf/tst-dlopenrpath
FAIL: elf/tst-latepthread
FAIL: elf/tst-leaks1-mem
FAIL: elf/tst-nodelete-dlclose
FAIL: elf/unload6
FAIL: nss/tst-nss-test1

-- 
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/21665] Multiple heap based buffer overflow in the objdump tool of the GNU Binutils.

2017-06-26 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=21665

--- Comment #1 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=cfd14a500e0485374596234de4db10e88ebc7618

commit cfd14a500e0485374596234de4db10e88ebc7618
Author: Nick Clifton 
Date:   Mon Jun 26 15:25:08 2017 +0100

Fix address violations when atempting to parse fuzzed binaries.

PR binutils/21665
bfd * opncls.c (get_build_id): Check that the section is beig enough
to contain the whole note.
* compress.c (bfd_get_full_section_contents): Check for and reject
a section whoes size is greater than the size of the entire file.
* elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
contain a notes section.

binutils* objdump.c (disassemble_section): Skip any section that is bigger
than the entire 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 binutils/21665] Multiple heap based buffer overflow in the objdump tool of the GNU Binutils.

2017-06-26 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21665

Nick Clifton  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||nickc at redhat dot com
 Resolution|--- |FIXED

--- Comment #2 from Nick Clifton  ---
Hi Owl,

  Thanks for reporting these bugs.  I have checked in a patch which should
  address both issues, but if you find that either of the files still causes
  faults when you test them please feel free to reopen this PR.

Cheers
  Nick

-- 
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/21659] strings behaviour when called on a directory

2017-06-26 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21659

--- Comment #5 from Nick Clifton  ---
Hi Jon,

  I could not reproduce the behaviour you describe for ld and ar - they
  both say "Is a directory" for me.  This is with the latest mainline
  sources however.  Objcopy did behave as you said, so I have checked in
  a small patch to make it also generate an "Is a directory" message.

Cheers
  Nick

-- 
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/21670] A stack buffer overflow in the nm tool of the GNU Binutils.

2017-06-26 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=21670

--- Comment #1 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=04e15b4a9462cb1ae819e878a6009829aab8020b

commit 04e15b4a9462cb1ae819e878a6009829aab8020b
Author: Nick Clifton 
Date:   Mon Jun 26 15:46:34 2017 +0100

Fix address violation parsing a corrupt texhex format file.

PR binutils/21670
* tekhex.c (getvalue): Check for the source pointer exceeding the
end pointer before the first byte is read.

-- 
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/21670] A stack buffer overflow in the nm tool of the GNU Binutils.

2017-06-26 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21670

Nick Clifton  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||nickc at redhat dot com
 Resolution|--- |FIXED

--- Comment #2 from Nick Clifton  ---
Hi Owl,

  Thanks for reporting this bug.  I have checked in a small patch to fix
  the problem, which was a simple case of not checking for a buffer overrun
  early enough.

Cheers
  Nick

-- 
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/21665] Multiple heap based buffer overflow in the objdump tool of the GNU Binutils.

2017-06-26 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21665

H.J. Lu  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
   Last reconfirmed||2017-06-26
 CC||hjl.tools at gmail dot com
 Resolution|FIXED   |---
 Ever confirmed|0   |1

--- Comment #3 from H.J. Lu  ---
(In reply to cvs-com...@gcc.gnu.org from comment #1)
> The master branch has been updated by Nick Clifton :
> 
> https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;
> h=cfd14a500e0485374596234de4db10e88ebc7618
> 
> commit cfd14a500e0485374596234de4db10e88ebc7618
> Author: Nick Clifton 
> Date:   Mon Jun 26 15:25:08 2017 +0100
> 
> Fix address violations when atempting to parse fuzzed binaries.
> 
>   PR binutils/21665
> bfd   * opncls.c (get_build_id): Check that the section is beig enough
>   to contain the whole note.
>   * compress.c (bfd_get_full_section_contents): Check for and reject
>   a section whoes size is greater than the size of the entire file.
>   * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
>   contain a notes section.
> 
> binutils* objdump.c (disassemble_section): Skip any section that is
> bigger
>   than the entire file.

This patch caused:

FAIL: Build libfoo.so with compressed debug sections
FAIL: Build libbar.so with compressed debug sections
FAIL: Build libfoozlib.so with compressed debug sections with zlib-gabi
FAIL: Build libbarzlib.so with compressed debug sections with zlib-gabi
FAIL: Build libzlibfoo.so with zlib compressed debug sections
FAIL: Build libgnufoo.so with zlib-gnu compressed debug sections
FAIL: Build libgabifoo.so with zlib-gabi compressed debug sections
FAIL: Build gabiend.o with zlib-gabi compressed debug sections
FAIL: Run normal with libfoo.so with compressed debug sections
FAIL: Run normal with libfoozlib.so with compressed debug sections with
zlib-gabi
FAIL: Run zlibnormal with libzlibfoo.so with zlib compressed debug sections
FAIL: Run zlibnormal with libfoozlib.so with zlib compressed debug sections
FAIL: Run gnunormal with libgnufoo.so with zlib-gnu compressed debug sections
FAIL: Run gnunormal with libfoozlib.so with zlib-gnu compressed debug sections
FAIL: Run gabinormal with libgabifoo.so with zlib-gabi compressed debug
sections
FAIL: Run gabinormal with libfoozlib.so with zlib-gabi compressed debug
sections
FAIL: Link with zlib-gabi compressed debug input
FAIL: Link -r with zlib-gabi compressed debug output
FAIL: Link with zlib compressed debug output
FAIL: Link with zlib-gnu compressed debug output
FAIL: Link with zlib-gabi compressed debug output

with GCC 4.2 on x86-64.

-- 
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/21665] Multiple heap based buffer overflow in the objdump tool of the GNU Binutils.

2017-06-26 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=21665

--- Comment #4 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=0630b49c470ca2e3c3f74da4c7e4ff63440dd71f

commit 0630b49c470ca2e3c3f74da4c7e4ff63440dd71f
Author: H.J. Lu 
Date:   Mon Jun 26 09:24:49 2017 -0700

Check file size before getting section contents

Don't check the section size in bfd_get_full_section_contents since
the size of a decompressed section may be larger than the file size.
Instead, check file size in _bfd_generic_get_section_contents.

PR binutils/21665
* compress.c (bfd_get_full_section_contents): Don't check the
file size here.
* libbfd.c (_bfd_generic_get_section_contents): Check for and
reject a section whoes size + offset is greater than the size
of the entire file.
(_bfd_generic_get_section_contents_in_window): 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 binutils/21665] Multiple heap based buffer overflow in the objdump tool of the GNU Binutils.

2017-06-26 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21665

H.J. Lu  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |2.29

--- Comment #5 from H.J. Lu  ---
Fixed for 2.29.

-- 
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 gold/21676] New: Gold doesn't support INSERT in linker script

2017-06-26 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21676

Bug ID: 21676
   Summary: Gold doesn't support INSERT in linker script
   Product: binutils
   Version: 2.29 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: gold
  Assignee: ccoutant at gmail dot com
  Reporter: hjl.tools at gmail dot com
CC: ian at airs dot com
  Target Milestone: ---

'INSERT [ AFTER | BEFORE ] OUTPUT_SECTION'
 This command is typically used in a script specified by '-T' to
 augment the default 'SECTIONS' with, for example, overlays.  It
 inserts all prior linker script statements after (or before)
 OUTPUT_SECTION, and also causes '-T' to not override the default
 linker script.  The exact insertion point is as for orphan
 sections.  *Note Location Counter::.  The insertion happens after
 the linker has mapped input sections to output sections.  Prior to
 the insertion, since '-T' scripts are parsed before the default
 linker script, statements in the '-T' script occur before the
 default linker script statements in the internal linker
 representation of the script.  In particular, input section
 assignments will be made to '-T' output sections before those in
 the default script.  Here is an example of how a '-T' script using
 'INSERT' might look:

  SECTIONS
  {
OVERLAY :
{
  .ov1 { ov1*(.text) }
  .ov2 { ov2*(.text) }
}
  }
  INSERT AFTER .text;

[hjl@gnu-6 gold]$ cat x.s 
.text
.globl  foo
foo:
.dc.a xxx

.section .bar,"a",%progbits
.globl bar
bar:
.dc.a xxx
[hjl@gnu-6 gold]$ cat x.t
SECTIONS
{
   .bar : { *(.bar) }
}
INSERT AFTER .rela.dyn;
[hjl@gnu-6 gold]$ gcc -c x.s
[hjl@gnu-6 gold]$ ld -shared -T x.t x.o
[hjl@gnu-6 gold]$ readelf -SW a.out 
There are 12 section headers, starting at offset 0x1238:

Section Headers:
  [Nr] Name  TypeAddress  OffSize   ES Flg
Lk Inf Al
  [ 0]   NULL 00 00 00 
0   0  0
  [ 1] .hash HASH0120 000120 30 04   A 
2   0  8
  [ 2] .dynsym   DYNSYM  0150 000150 a8 18   A 
3   1  8
  [ 3] .dynstr   STRTAB  01f8 0001f8 25 00   A 
0   0  1
  [ 4] .rela.dyn RELA0220 000220 30 18   A 
2   0  8
  [ 5] .bar  PROGBITS0250 000250 08 00   A 
0   0  1
  [ 6] .text PROGBITS0258 000258 08 00  AX 
0   0  1
  [ 7] .eh_frame PROGBITS0260 000260 00 00   A 
0   0  8
  [ 8] .dynamic  DYNAMIC 00200f10 000f10 f0 10  WA 
3   0  8
  [ 9] .symtab   SYMTAB   001000 000198 18
10  11  8
  [10] .strtab   STRTAB   001198 44 00 
0   0  1
  [11] .shstrtab STRTAB   0011dc 59 00 
0   0  1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
  L (link order), O (extra OS processing required), G (group), T (TLS),
  C (compressed), x (unknown), o (OS specific), E (exclude),
  l (large), p (processor specific)
[hjl@gnu-6 gold]$

-- 
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/21677] New: ld 2.27 has unexplained 10x performance improvement in some cases

2017-06-26 Thread mail at nh2 dot me
https://sourceware.org/bugzilla/show_bug.cgi?id=21677

Bug ID: 21677
   Summary: ld 2.27 has unexplained 10x performance improvement in
some cases
   Product: binutils
   Version: 2.26
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: ld
  Assignee: unassigned at sourceware dot org
  Reporter: mail at nh2 dot me
  Target Milestone: ---

Hi,

the GHC Haskell compiler uses ld to link its binaries.

There is currently a performance regression in GHC 8.2 that makes linking with
ld 40x slower than it was in GHC 8.0.

But we found that ld 2.27 made this regression 10x less bad than ld 2.26:

https://ghc.haskell.org/trac/ghc/ticket/13739#comment:21
https://ghc.haskell.org/trac/ghc/attachment/ticket/13739/T13739-check-ld-output

My question:

Are you aware of any performance improvement in the 2.27 release that would
explain the 10x speedup?

I read through
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob_plain;f=ld/NEWS;hb=refs/tags/binutils-2_27
but couldn't find any.

While it's great that ld 2.27 got faster, we would really like to know what
made it faster.

That might help us figure out our bug, and other users of ld would probably
also benefit from knowing about it.

Thanks!

-- 
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/21677] ld 2.27 has unexplained 10x performance improvement in some cases

2017-06-26 Thread mail at nh2 dot me
https://sourceware.org/bugzilla/show_bug.cgi?id=21677

mail at nh2 dot me changed:

   What|Removed |Added

 CC||mail at nh2 dot me

-- 
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/21677] ld 2.27 has unexplained 10x performance improvement in some cases

2017-06-26 Thread douglas.wilson at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21677

Doug  changed:

   What|Removed |Added

 CC||douglas.wilson at gmail dot com

--- Comment #1 from Doug  ---
Some additional detail:

This behaviour appears only while linking executables with 

gcc -Wl,--gc-sections

against .a archives that contain object code compiled with 

gcc -ffunction-sections -fdata-sections

-- 
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/21677] ld 2.27 has unexplained 10x performance improvement in some cases

2017-06-26 Thread slyfox at inbox dot ru
https://sourceware.org/bugzilla/show_bug.cgi?id=21677

Sergei Trofimovich  changed:

   What|Removed |Added

 CC||slyfox at inbox dot ru

--- Comment #2 from Sergei Trofimovich  ---
I suggest running ld under 'perf record' / 'perf report' to get the idea where
ld used to spend time. Maybe it will shed some light.

Otherwise bisection is always an option.

-- 
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/21677] ld 2.27 has unexplained 10x performance improvement in some cases

2017-06-26 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21677

H.J. Lu  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2017-06-26
 CC||hjl.tools at gmail dot com
 Ever confirmed|0   |1

--- Comment #3 from H.J. Lu  ---
(In reply to Doug from comment #1)
> Some additional detail:
> 
> This behaviour appears only while linking executables with 
> 
> gcc -Wl,--gc-sections
> 
> against .a archives that contain object code compiled with 
> 
> gcc -ffunction-sections -fdata-sections

Did you see the improvement on ALL targets or just x86 targets?
This commit:

commit d968975277ba280372002800c6c25bb1b29f496e
Author: H.J. Lu 
Date:   Wed Apr 20 05:26:37 2016 -0700

Check ELF relocs after opening all input files

Delaying checking ELF relocations until opening all input files so
that symbol information is final when relocations are checked.  This
is only enabled for x86 targets.

improved --gc-sections performance, but only on x86.

-- 
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/21677] ld 2.27 has unexplained 10x performance improvement in some cases

2017-06-26 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21677

--- Comment #4 from H.J. Lu  ---
(In reply to H.J. Lu from comment #3)
> (In reply to Doug from comment #1)
> > Some additional detail:
> > 
> > This behaviour appears only while linking executables with 
> > 
> > gcc -Wl,--gc-sections
> > 
> > against .a archives that contain object code compiled with 
> > 
> > gcc -ffunction-sections -fdata-sections
> 
> Did you see the improvement on ALL targets or just x86 targets?
> This commit:
> 
> commit d968975277ba280372002800c6c25bb1b29f496e
> Author: H.J. Lu 
> Date:   Wed Apr 20 05:26:37 2016 -0700
> 
> Check ELF relocs after opening all input files
> 
> Delaying checking ELF relocations until opening all input files so
> that symbol information is final when relocations are checked.  This
> is only enabled for x86 targets.
> 
> improved --gc-sections performance, but only on x86.

Also this patch:

commit fbf05aa70d7a6ad3dd92ca718faa4bb383b975ee
Author: H.J. Lu 
Date:   Wed Apr 20 17:06:58 2016 -0700

Move ELF relocation check after lang_gc_sections

Move ELF relocation check after lang_gc_sections so that all the
reference counting code for plt and got relocs can be removed.  This
only affects ELF targets which check relocations after opening all
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 gold/21678] New: powerpc-oe-linux-ld.gold: error: invalid STB_LOCAL symbol in external symbols

2017-06-26 Thread rwmacleod at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21678

Bug ID: 21678
   Summary: powerpc-oe-linux-ld.gold: error: invalid STB_LOCAL
symbol in external symbols
   Product: binutils
   Version: 2.28
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: gold
  Assignee: ccoutant at gmail dot com
  Reporter: rwmacleod at gmail dot com
CC: ian at airs dot com
  Target Milestone: ---

When building systemd for qemuppc using oe-core/master
(http://cgit.openembedded.org/openembedded-core/commit/?id=7c36b4316ad185088c65a4db8a84b5fcba9eef06
specifically), 
gold will fail to link with an error like:


powerpc-oe-linux-libtool: link: powerpc-oe-linux-gcc  \
  -m32 -mhard-float -mcpu=7400 -mno-spe \
 
--sysroot=/.../tmp-glibc/work/ppc7400-oe-linux/systemd/1_232-r0/recipe-sysroot
\
  -shared  -fPIC -DPIC  \
  src/basic/.libs/libsystemd_shared_la-capability-util.o \
  src/basic/.libs/libsystemd_shared_la-conf-files.o \
  src/basic/.libs/libsystemd_shared_la-hostname-util.o \
  ...
  src/libudev/.libs/libsystemd_shared_la-libudev-queue.o \
  src/libudev/.libs/libsystemd_shared_la-libudev-hwdb.o \
  -lcap -lrt -lm -lresolv -llzma -lacl  \
  -m32 -mhard-float -mcpu=7400 -mno-spe \
 
--sysroot=/.../tmp-glibc/work/ppc7400-oe-linux/systemd/1_232-r0/recipe-sysroot
\
  -fstack-protector -fstack-protector-strong -flto -fstack-protector
-fstack-protector-strong \
  -flto -pthread -fstack-protector -fstack-protector-strong -flto
-fstack-protector -fstack-protector-strong \
  -flto -O2 -g \
  -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined \
  -Wl,-z -Wl,relro -Wl,-z -Wl,now -Wl,-fuse-ld=gold \
  -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed   -pthread \
  -Wl,-soname -Wl,libsystemd-shared-232.so 
  -o  .libs/libsystemd-shared-232.so 



/.../tmp-glibc/work/ppc7400-oe-linux/systemd/1_232-r0/recipe-sysroot-native\
/usr/bin/powerpc-oe-linux/powerpc-oe-linux-ld.gold:
   error: invalid STB_LOCAL symbol in external symbols 
   error: linker defined: multiple definition of
'0001.plt_call.memcpy+8000'
   command line: previous definition here
...> 5000 identical lines, with functions/symbols such as:
'0001.plt_call.fflush_and_check+8000'
'0001.plt_call.fileno+8000'
'0001.plt_call.fchmod+8000'

| collect2: error: ld returned 1 exit status
| Makefile:11575: recipe for target 'libsystemd-shared.la' failed
| make[2]: *** [libsystemd-shared.la] Error 1
| Makefile:21970: recipe for target 'all-recursive' failed
| make[1]: *** [all-recursive] Error 1
| Makefile:9900: recipe for target 'all' failed
| make: *** [all] Error 2
| ERROR: oe_runmake failed

I can provide instructions on how to reproduce this using oe-core or if needed,
I'll try to create a simpler reproducer as per your guidance. oe-core
instructions are here: https://bugzilla.yoctoproject.org/show_bug.cgi?id=11696

This only affects qemuppc and I assume all powerpc targets.


A similar error occurs when building webkitgtk version 2.16.1

-- 
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 gold/15373] Gold does not support the "INSERT" command in linker scripts

2017-06-26 Thread ccoutant at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=15373

Cary Coutant  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|ian at airs dot com|ccoutant at gmail dot 
com

-- 
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 gold/21676] Gold doesn't support INSERT in linker script

2017-06-26 Thread ccoutant at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21676

Cary Coutant  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #1 from Cary Coutant  ---
Duplicate of PR 15373

-- 
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 gold/15373] Gold does not support the "INSERT" command in linker scripts

2017-06-26 Thread ccoutant at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=15373

Cary Coutant  changed:

   What|Removed |Added

 CC||hjl.tools at gmail dot com

--- Comment #3 from Cary Coutant  ---
*** Bug 21676 has been marked as a duplicate of this bug. ***

-- 
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 gold/21676] Gold doesn't support INSERT in linker script

2017-06-26 Thread ccoutant at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21676

Cary Coutant  changed:

   What|Removed |Added

 Resolution|FIXED   |DUPLICATE

--- Comment #2 from Cary Coutant  ---


*** This bug has been marked as a duplicate of bug 15373 ***

-- 
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/21665] Multiple heap based buffer overflow in the objdump tool of the GNU Binutils.

2017-06-26 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=21665

--- Comment #6 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=1f473e3d0ad285195934e6a077c7ed32afe66437

commit 1f473e3d0ad285195934e6a077c7ed32afe66437
Author: H.J. Lu 
Date:   Mon Jun 26 15:47:16 2017 -0700

Add a missing line to _bfd_generic_get_section_contents_in_window

PR binutils/21665
* libbfd.c (_bfd_generic_get_section_contents_in_window): Add
a missing line.

-- 
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/21679] New: bfd_get_file_size should be cached for readonly file

2017-06-26 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21679

Bug ID: 21679
   Summary: bfd_get_file_size should be cached for readonly file
   Product: binutils
   Version: 2.29 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: ld
  Assignee: unassigned at sourceware dot org
  Reporter: hjl.tools at gmail dot com
  Target Milestone: ---

bfd_get_file_size may be called many times on the same input file with
many sections.  It should be cached to avoid calling fstat over and over
again.

-- 
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/21665] Multiple heap based buffer overflow in the objdump tool of the GNU Binutils.

2017-06-26 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=21665

--- Comment #7 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Pedro Alves :

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

commit ab27f80c5dceaa23c4ba7f62c0d5d22a5d5dd7a1
Author: Pedro Alves 
Date:   Tue Jun 27 00:21:25 2017 +0100

Fix GDB regressions caused by previous bfd_get_section_contents changes

Ref: https://sourceware.org/ml/binutils/2017-06/msg00343.html

bfd/ChangeLog:
2017-06-26  Pedro Alves  

PR binutils/21665
* libbfd.c (_bfd_generic_get_section_contents): Add "count", not
"sz".

-- 
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/21665] Multiple heap based buffer overflow in the objdump tool of the GNU Binutils.

2017-06-26 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=21665

--- Comment #8 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Alan Modra :

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

commit 7211ae501eb0de1044983f2dfb00091a58fbd66c
Author: Alan Modra 
Date:   Tue Jun 27 09:45:04 2017 +0930

More fixes for bfd_get_section_contents change

PR binutils/21665
* libbfd.c (_bfd_generic_get_section_contents): Delete abort.
Use unsigned file pointer type, and remove cast.
* libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
Add "count", not "sz".

-- 
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/21659] strings behaviour when called on a directory

2017-06-26 Thread jg at jguk dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=21659

--- Comment #6 from Jon Grant  ---
Hi Nick

Great!

Yes, maybe mine is too old. I'm on Ubuntu LTS binutils 2.26.1

Do you think okay to be a Warning as opposed to Error? the "gold" linker calls
it a fatal error.


$ gold mydir
gold: fatal error: mydir: pread failed: Is a directory

Regards, Jon

-- 
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/21679] bfd_get_file_size should be cached for readonly file

2017-06-26 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21679

Alan Modra  changed:

   What|Removed |Added

 CC||amodra at gmail dot com

--- Comment #1 from Alan Modra  ---
Is there a good reason for bfd_get_file_size to be called before reading
sections?  Only for archives, I'd guess.  For object files, you can just wait
for the read to return a count less than expected.

-- 
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/21679] bfd_get_file_size should be cached for readonly file

2017-06-26 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21679

--- Comment #2 from H.J. Lu  ---
(In reply to Alan Modra from comment #1)
> Is there a good reason for bfd_get_file_size to be called before reading
> sections?  Only for archives, I'd guess.  For object files, you can just
> wait for the read to return a count less than expected.

For corrupted object files, the section offset and size may be incorrect.
The check is supposed to prevent reading beyond the end of file.  If it
can be done in a different way to avoid calling bfd_get_file_size, we
should change it.

-- 
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/21679] bfd_get_file_size should be cached for readonly file

2017-06-26 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21679

--- Comment #3 from Alan Modra  ---
My point is that you *can't* read beyond the end of an object file, unless it
is inside an archive.  So you only need to check archives, and the archive
check doesn't call fstat.

-- 
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/21665] Multiple heap based buffer overflow in the objdump tool of the GNU Binutils.

2017-06-26 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=21665

--- Comment #9 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Alan Modra :

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

commit ea9aafc41a764e4e2dbb88a7b031e886b481b99a
Author: Alan Modra 
Date:   Tue Jun 27 14:43:49 2017 +0930

Warning fix

PR binutils/21665
* libbfd.c (_bfd_generic_get_section_contents): Warning fix.
(_bfd_generic_get_section_contents_in_window): 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