[Bug binutils/21233] Internal error, /usr/bin/ld: BFD (GNU Binutils for Debian) 2.28 assertion fail ../../bfd/elfxx-mips.c:3861

2017-04-04 Thread hp at sourceware dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=21233

Hans-Peter Nilsson  changed:

   What|Removed |Added

 CC||hp at sourceware dot org

-- 
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/21233] Internal error, /usr/bin/ld: BFD (GNU Binutils for Debian) 2.28 assertion fail ../../bfd/elfxx-mips.c:3861

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

--- Comment #17 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Hans-Peter Nilsson :

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

commit 4d5efb852be6554305dfaf17c1e4f07bb9514273
Author: Hans-Peter Nilsson 
Date:   Wed Apr 5 03:00:40 2017 +0200

PR ld/21233: xfail failing test-parts for cris*-*-*

-- 
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/21306] Different behavior when linking common symbol statically or to shared object

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

Alan Modra  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-04-04
 CC||amodra at gmail dot com,
   ||hjl.tools at gmail dot com
 Depends on||19579
 Ever confirmed|0   |1

--- Comment #1 from Alan Modra  ---
This behaviour was introduced with git commit 07492f668d.
https://sourceware.org/ml/binutils/2016-03/msg00082.html


Referenced Bugs:

https://sourceware.org/bugzilla/show_bug.cgi?id=19579
[Bug 19579] [Regression] link error linking fortran code with PIE
-- 
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/19579] [Regression] link error linking fortran code with PIE

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

Alan Modra  changed:

   What|Removed |Added

 Blocks||21306


Referenced Bugs:

https://sourceware.org/bugzilla/show_bug.cgi?id=21306
[Bug 21306] Different behavior when linking common symbol statically or to
shared object
-- 
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/20828] GC-ed DSO symbols make corresponding symbols defined by a linker script local

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

--- Comment #36 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Maciej W. Rozycki :

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

commit 80070c0d3491347f11283c5791b9dd040fedbd4f
Author: Maciej W. Rozycki 
Date:   Mon Mar 27 12:39:07 2017 +0100

PR ld/21233: Avoid sweeping forced-undefined symbols in section GC

Complement commit 902e9fc76a0e ("PR ld/20828: Move symbol version
processing ahead of GC symbol sweep"), commit b531344c34b0 ("PR
ld/20828: Reorder the symbol sweep stage of section GC") and commit
81ff47b3a546 ("PR ld/20828: Fix linker script symbols wrongly forced
local with section GC"), and prevent symbols forcibly entered in the
output file with the use of the `--undefined=' or `--require-defined='
linker command line options or the EXTERN linker script command from
being swept in section garbage collection and consequently recorded in
the dynamic symbol table as local entries.  This happens in certain
circumstances, where a symbol reference also exists in one of the static
input files, however only in a section which is garbage-collected and
does not make it to the output file, and the symbol is defined in a
dynamic object present in the link.

For example with the `i386-linux' target and the `pr21233.s' and
`pr21233-l.s' sources, and the `pr21233.ld' linker script included with
this change we get:

$ as -o pr21233-l.o pr21233-l.s
$ ld -shared -T pr21233.ld -o libpr21233.so pr21233-l.o
$ as -o pr21233.o pr21233.s
$ ld --gc-sections -e foo --require-defined=bar -T pr21233.ld -o pr21233
pr21233.o libpr21233.so
$ readelf --dyn-syms pr21233

Symbol table '.dynsym' contains 2 entries:
   Num:Value  Size TypeBind   Vis  Ndx Name
 0:  0 NOTYPE  LOCAL  DEFAULT  UND
 1:  0 OBJECT  LOCAL  DEFAULT  UND bar
$

which makes the run-time `bar' dependency of the `pr21233' executable
different from its corresponding link-time dependency, i.e. the presence
of `libpr21233.so' and its `bar' symbol is required at the link time,
however at the run time a copy of `libpr21233.so' without `bar' will do.
Similarly with `--undefined=' and EXTERN which do not actually require
the reference to the symbol requested to be satisfied with a definition
at the link time, however once the definition has been pulled at the
link time, so it should at the dynamic load time.

Additionally with the `mips-linux' target we get:

$ ld --gc-sections -e foo --require-defined=bar -T pr21233.ld -o pr21233
pr21233.o libpr21233.so
ld: BFD (GNU Binutils) 2.28.51.20170324 assertion fail
.../bfd/elfxx-mips.c:3861
$

as the target is not prepared to handle such a local dynamic symbol.

With this change in effect we get:

$ readelf --dyn-syms pr21233

Symbol table '.dynsym' contains 2 entries:
   Num:Value  Size TypeBind   Vis  Ndx Name
 0:  0 NOTYPE  LOCAL  DEFAULT  UND
 1:  0 OBJECT  GLOBAL DEFAULT  UND bar
$

instead, for both targets.

ld/
PR ld/21233
* ldlang.c (insert_undefined): Set `mark' for ELF symbols.
* testsuite/ld-elf/pr21233.sd: New test.
* testsuite/ld-elf/pr21233-l.sd: New test.
* testsuite/ld-elf/pr21233.ld: New test linker script.
* testsuite/ld-elf/pr21233-e.ld: New test linker script.
* testsuite/ld-elf/pr21233.s: New test source.
* testsuite/ld-elf/pr21233-l.s: New test source.
* testsuite/ld-elf/shared.exp: Run the new tests.

-- 
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/21233] Internal error, /usr/bin/ld: BFD (GNU Binutils for Debian) 2.28 assertion fail ../../bfd/elfxx-mips.c:3861

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

--- Comment #16 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Maciej W. Rozycki :

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

commit 80070c0d3491347f11283c5791b9dd040fedbd4f
Author: Maciej W. Rozycki 
Date:   Mon Mar 27 12:39:07 2017 +0100

PR ld/21233: Avoid sweeping forced-undefined symbols in section GC

Complement commit 902e9fc76a0e ("PR ld/20828: Move symbol version
processing ahead of GC symbol sweep"), commit b531344c34b0 ("PR
ld/20828: Reorder the symbol sweep stage of section GC") and commit
81ff47b3a546 ("PR ld/20828: Fix linker script symbols wrongly forced
local with section GC"), and prevent symbols forcibly entered in the
output file with the use of the `--undefined=' or `--require-defined='
linker command line options or the EXTERN linker script command from
being swept in section garbage collection and consequently recorded in
the dynamic symbol table as local entries.  This happens in certain
circumstances, where a symbol reference also exists in one of the static
input files, however only in a section which is garbage-collected and
does not make it to the output file, and the symbol is defined in a
dynamic object present in the link.

For example with the `i386-linux' target and the `pr21233.s' and
`pr21233-l.s' sources, and the `pr21233.ld' linker script included with
this change we get:

$ as -o pr21233-l.o pr21233-l.s
$ ld -shared -T pr21233.ld -o libpr21233.so pr21233-l.o
$ as -o pr21233.o pr21233.s
$ ld --gc-sections -e foo --require-defined=bar -T pr21233.ld -o pr21233
pr21233.o libpr21233.so
$ readelf --dyn-syms pr21233

Symbol table '.dynsym' contains 2 entries:
   Num:Value  Size TypeBind   Vis  Ndx Name
 0:  0 NOTYPE  LOCAL  DEFAULT  UND
 1:  0 OBJECT  LOCAL  DEFAULT  UND bar
$

which makes the run-time `bar' dependency of the `pr21233' executable
different from its corresponding link-time dependency, i.e. the presence
of `libpr21233.so' and its `bar' symbol is required at the link time,
however at the run time a copy of `libpr21233.so' without `bar' will do.
Similarly with `--undefined=' and EXTERN which do not actually require
the reference to the symbol requested to be satisfied with a definition
at the link time, however once the definition has been pulled at the
link time, so it should at the dynamic load time.

Additionally with the `mips-linux' target we get:

$ ld --gc-sections -e foo --require-defined=bar -T pr21233.ld -o pr21233
pr21233.o libpr21233.so
ld: BFD (GNU Binutils) 2.28.51.20170324 assertion fail
.../bfd/elfxx-mips.c:3861
$

as the target is not prepared to handle such a local dynamic symbol.

With this change in effect we get:

$ readelf --dyn-syms pr21233

Symbol table '.dynsym' contains 2 entries:
   Num:Value  Size TypeBind   Vis  Ndx Name
 0:  0 NOTYPE  LOCAL  DEFAULT  UND
 1:  0 OBJECT  GLOBAL DEFAULT  UND bar
$

instead, for both targets.

ld/
PR ld/21233
* ldlang.c (insert_undefined): Set `mark' for ELF symbols.
* testsuite/ld-elf/pr21233.sd: New test.
* testsuite/ld-elf/pr21233-l.sd: New test.
* testsuite/ld-elf/pr21233.ld: New test linker script.
* testsuite/ld-elf/pr21233-e.ld: New test linker script.
* testsuite/ld-elf/pr21233.s: New test source.
* testsuite/ld-elf/pr21233-l.s: New test source.
* testsuite/ld-elf/shared.exp: Run the new tests.

-- 
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/21348] odr-violation in libiberty/safe-ctype.c

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

Nick Clifton  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |WONTFIX

--- Comment #3 from Nick Clifton  ---
Punt on this one for now.  If we ever shift to requiring a C++ compiler to
build the binutils then we can revisit this issue.

-- 
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/21342] two member access within null pointer

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

Nick Clifton  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #10 from Nick Clifton  ---
Hi Agostino,

> I need to admit that I missed to say that binutils was compiled with
> clang-4. Can you give it a try?

Sadly no.  Fedora 25 only has clang-3.9, at that is unable to compile with
sanitization enabled.  (Because of some silly library problem).  But, I was
able to compile the binutils with clang-5, and that did indeed trigger the
problem that you reported.  Fortunately this also meant that I was able to test
my proposed patch and find that it worked.  So the patch is in and the bug is
closed. :-)

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 ld/21342] two member access within null pointer

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

--- Comment #9 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=ad32986fdf9da1c8748e47b8b45100398223dba8

commit ad32986fdf9da1c8748e47b8b45100398223dba8
Author: Nick Clifton 
Date:   Tue Apr 4 11:23:36 2017 +0100

Fix null pointer dereferences when using a link built with clang.

PR binutils/21342
* elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
dereference.
(bfd_elf_final_link): Only initialize the extended symbol index
section if there are extended symbol tables to list.

-- 
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/21351] New: documentation for --relax

2017-04-04 Thread weremaid at gmx dot de
https://sourceware.org/bugzilla/show_bug.cgi?id=21351

Bug ID: 21351
   Summary: documentation for --relax
   Product: binutils
   Version: unspecified
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: ld
  Assignee: unassigned at sourceware dot org
  Reporter: weremaid at gmx dot de
  Target Milestone: ---

Created attachment 9968
  --> https://sourceware.org/bugzilla/attachment.cgi?id=9968&action=edit
patch containing alternative

The documentation for --relax isn't clear about whether or not the use of
--no-relax causes an error when the feature is not supported on a platform.

The sentence in question is:
"On platforms where --relax is accepted the option --no-relax can be used to
disable the feature."
(there's a comma missing after "accepted")

The set containing all platforms has previously been divided into those where
it is 1. supported or 2. ignored. 
("On platforms where this is not supported, --relax is accepted, but ignored.")

If I'm not mistaken, the conditional "On platforms where --relax is accepted"
means "all platforms".

Imho, "[On all platforms,] --no-relax can be used to disable the feature"
should then also distinguish between supported and merely ignored.

There's a patch with a proposal attached.

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