[Bug ld/23055] Multiple memory corruption in ld-new (binuitils-2.30-15ubuntu1)

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

Nick Clifton  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Nick Clifton  ---
It looks like H.J. has fixed the x86 bug, so I am closing this PR.

-- 
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/23062] Crash in readelf (assertion failure)

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

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

commit a7504f87d41694d441fabb3308631df4d2750c24
Author: Nick Clifton 
Date:   Wed Apr 18 12:03:03 2018 +0100

Prevent an assertion failure in readelf & objdump when parsing corrupt
DWARF information.

PR 23062
* dwarf.c (read_and_display_attr_value): Replace assertions with
test and warning 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 binutils/23062] Crash in readelf (assertion failure)

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

Nick Clifton  changed:

   What|Removed |Added

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

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

  Thanks for reporting this bug.  I have checked in a patch to replace
  the assertion that was being triggered with a warning 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/23059] OOM-Bug in cxxfilt (binuitils-2.30-15ubuntu1)

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

Nick Clifton  changed:

   What|Removed |Added

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

--- Comment #1 from Nick Clifton  ---
Hi Sergej,

  Thanks for reporting these bugs.  The problem however is in the C++ name
  demangler, which is part of the libiberty library.  This library is
  maintained by the gcc project, not the binutils project.  (It is used
  by the binutils, but now owned by them).  Therefore, please could you
  refile this bug report on the gcc bugzilla system:

https://gcc.gnu.org/bugzilla/enter_bug.cgi?product=gcc

  Thanks very much.

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 gprof/23056] Multiple memory corruption in gprof (binuitils-2.30-15ubuntu1)

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

Nick Clifton  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2018-04-18
 CC||nickc at redhat dot com
 Ever confirmed|0   |1

--- Comment #1 from Nick Clifton  ---
Hi Sergej,

  Thanks for reporting these bugs.  Unfortunately I cannot reproduce them.
  Are you sure that the command line is correct ?  When I run "gprof $file"
  I just get an error message: "not in executable format".   I suspect that
  this is because I am running the tests on a 64-bit x86_64 host...  Are you
  able to reproduce the failures in a 64-bit environment ?

  Also gprof normally needs a gmon.out file to go along with the executable,
  and this file is missing from the zip file you uploaded.

  I suspect that the "global-buffer-overflow" failure has already been
  addressed by the fix for PR 23055.  However the "heap-buffer-overflow"
  bug is in the gprof sources, and presumably still exists.

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/21446] Incorrect disassembly for msr to dbgdtrtx_el0 in AArch64

2018-04-18 Thread tnfchris at sourceware dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=21446

Tamar Christina  changed:

   What|Removed |Added

   Assignee|unassigned at sourceware dot org   |tnfchris 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/21446] Incorrect disassembly for msr to dbgdtrtx_el0 in AArch64

2018-04-18 Thread tnfchris at sourceware dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=21446

Tamar Christina  changed:

   What|Removed |Added

 Target||aarch64-*
   Target Milestone|--- |2.31

-- 
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/21446] Incorrect disassembly for msr to dbgdtrtx_el0 in AArch64

2018-04-18 Thread tnfchris at sourceware dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=21446

Tamar Christina  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-04-18
 CC||tnfchris at sourceware dot org
 Ever confirmed|0   |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 ld/23078] New: Weak alias to a weak symbol is not resolved correctly.

2018-04-18 Thread pftbest at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=23078

Bug ID: 23078
   Summary: Weak alias to a weak symbol is not resolved correctly.
   Product: binutils
   Version: 2.29
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: ld
  Assignee: unassigned at sourceware dot org
  Reporter: pftbest at gmail dot com
  Target Milestone: ---

Created attachment 10957
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10957&action=edit
Archive with code to reproduce this issue.

Example code

// main.c ---

void _start() {}

void DEFAULT_HANDLER() {
  *((int*)0x10) = 5;
}

// foo.c 

__attribute__((weak)) void DEFAULT_HANDLER() {
*((int*)0x10) = 1;
}

__attribute__((weak, alias("DEFAULT_HANDLER"))) void HARD_FAULT();
__attribute__((weak, alias("DEFAULT_HANDLER"))) void BUS_FAULT();

void (*VECTORS[])() = {
HARD_FAULT,
BUS_FAULT,
};

// compile with ---

gcc -Os -o main.o -c main.c
gcc -Os -o foo.o -c foo.c
ld main.o foo.o
objdump -d -j .text -j .data a.out > dump.txt

// 

VECTORS array points to a weak function instead of a strong function defined in
main.c

-- 
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/23079] Multiple PREVAILING_DEF_IRONLY for a same symbol in an archive

2018-04-18 Thread mliska at suse dot cz
https://sourceware.org/bugzilla/show_bug.cgi?id=23079

Martin Liska  changed:

   What|Removed |Added

 CC||hubicka at gcc dot gnu.org,
   ||rguenth at gcc dot gnu.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 ld/23079] New: Multiple PREVAILING_DEF_IRONLY for a same symbol in an archive

2018-04-18 Thread mliska at suse dot cz
https://sourceware.org/bugzilla/show_bug.cgi?id=23079

Bug ID: 23079
   Summary: Multiple PREVAILING_DEF_IRONLY for a same symbol in an
archive
   Product: binutils
   Version: 2.31 (HEAD)
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: ld
  Assignee: unassigned at sourceware dot org
  Reporter: mliska at suse dot cz
  Target Milestone: ---

Let's consider:

$ cat 1.i
int igt_subtest_jmpbuf, viewport;
$ cat 2.i
int igt_subtest_jmpbuf, viewport;

$ gcc -flto 1.i -c
$ gcc -flto 2.i -c
$ ar cru libx.la 1.o 2.o
$ ranlib libx.la

$ cat main.i
int igt_subtest_jmpbuf;
extern int viewport;
int main()
{
  return igt_subtest_jmpbuf;
}

$ gcc main.i libx.la -flto
lto1: fatal error: multiple prevailing defs for ‘viewport’
compilation terminated.
lto-wrapper: fatal error: gcc returned 1 exit status
compilation terminated.
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: error:
lto-wrapper failed
collect2: error: ld returned 1 exit status

It's caused by fact that:

$ cat main.res
3
main.o 2
190 57d43a0e4f2e4898 PREVAILING_DEF main
194 57d43a0e4f2e4898 PREVAILING_DEF_IRONLY igt_subtest_jmpbuf
libx.la@0xcc 2
188 65b5ba79fd3c2703 PREVAILING_DEF_IRONLY viewport
190 65b5ba79fd3c2703 RESOLVED_IR igt_subtest_jmpbuf
libx.la@0x9d8 2
188 253018f931e7b9de PREVAILING_DEF_IRONLY viewport
190 253018f931e7b9de RESOLVED_IR igt_subtest_jmpbuf

While ld.gold does:
$ cat main.res
cat main.res
1
main.o 2
190 f4c25c288a258244 PREVAILING_DEF main
194 f4c25c288a258244 PREVAILING_DEF_IRONLY igt_subtest_jmpbuf

If I modify main.i to:
$ cat main.i
int igt_subtest_jmpbuf;
extern int viewport;
int main()
{
  return igt_subtest_jmpbuf + viewport;
}

Then it's all fine with BFD resolution file looking as follows:

$ cat main.res
3
main.o 3
190 aa0f078bbef97098 PREVAILING_DEF main
194 aa0f078bbef97098 PREVAILING_DEF_IRONLY igt_subtest_jmpbuf
196 aa0f078bbef97098 RESOLVED_IR viewport
libx.la@0xcc 2
188 65b5ba79fd3c2703 PREVAILING_DEF_IRONLY viewport
190 65b5ba79fd3c2703 RESOLVED_IR igt_subtest_jmpbuf
libx.la@0x9d8 2
188 253018f931e7b9de RESOLVED_IR viewport
190 253018f931e7b9de RESOLVED_IR igt_subtest_jmpbuf

-- 
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/23079] Multiple PREVAILING_DEF_IRONLY for a same symbol in an archive

2018-04-18 Thread rguenth at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=23079

Richard Biener  changed:

   What|Removed |Added

 CC||hjl.tools at gmail dot com

--- Comment #1 from Richard Biener  ---
If you make viewport non-common (-fno-common), does that fix it as well?

-- 
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/23079] Multiple PREVAILING_DEF_IRONLY for a same symbol in an archive

2018-04-18 Thread mliska at suse dot cz
https://sourceware.org/bugzilla/show_bug.cgi?id=23079

--- Comment #2 from Martin Liska  ---
(In reply to Richard Biener from comment #1)
> If you make viewport non-common (-fno-common), does that fix it as well?

Yes, with res. file as follows:

$ cat main.res
2
main.o 2
190 3e1e8b5023c4516c PREVAILING_DEF main
194 3e1e8b5023c4516c RESOLVED_IR igt_subtest_jmpbuf
libx.la@0xcc 2
188 608e0e444e9214ca PREVAILING_DEF_IRONLY viewport
190 608e0e444e9214ca PREVAILING_DEF_IRONLY igt_subtest_jmpbuf

-- 
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 gprof/23056] Multiple memory corruption in gprof (binuitils-2.30-15ubuntu1)

2018-04-18 Thread sergej at schumilo dot de
https://sourceware.org/bugzilla/show_bug.cgi?id=23056

--- Comment #2 from Sergej Schumilo  ---
Hi Nick,
yes we can reproduce both ASAN reports on a 64-bit Linux environment (Ubuntu
16.04.2 LTS) using the attached 64-bit ASAN executable with only one command
line argument (global-buffer-overflow or heap-overflow-0x004fae16). To
reproduce our findings, you don't need an additional file or to pass an
additional command line argument to gprof. The ASAN executable of gprof is
based on the source files of binuitils-2.30-15ubuntu1.

Cheers,
Sergej

-- 
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/23079] Multiple PREVAILING_DEF_IRONLY for a same symbol in an archive

2018-04-18 Thread hubicka at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=23079

--- Comment #3 from Jan Hubicka  ---
Thanks for isolating this! The diagnostics is new in GCC 8. We may silence it
if we agree that choosing random prevailing variant is way to go.

Honza

-- 
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/23079] Multiple PREVAILING_DEF_IRONLY for a same symbol in an archive

2018-04-18 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=23079

H.J. Lu  changed:

   What|Removed |Added

   Assignee|unassigned at sourceware dot org   |hjl.tools at gmail dot 
com

--- Comment #4 from H.J. Lu  ---
I will take a look.

-- 
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/22978] [2.30, 2.31 Regression] TLS local-dynamic incorrectly linked on hppa-linux

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

Alan Modra  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||amodra at gmail dot com
   Assignee|unassigned at sourceware dot org   |amodra 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 ld/22978] [2.30, 2.31 Regression] TLS local-dynamic incorrectly linked on hppa-linux

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

--- Comment #1 from Alan Modra  ---
Created attachment 10959
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10959&action=edit
fix

I believe this should cure the problem

-- 
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/23079] Multiple PREVAILING_DEF_IRONLY for a same symbol in an archive

2018-04-18 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=23079

--- Comment #5 from H.J. Lu  ---
Gold works only because it treats COMMON symbol like definition:

[hjl@gnu-tools-1 nolto]$ cat main.c
#include 

int igt_subtest_jmpbuf;
int main ()
{
  printf ("igt_subtest_jmpbuf: %d\n", igt_subtest_jmpbuf);
  return 0;
}
[hjl@gnu-tools-1 nolto]$ cat x.i
int igt_subtest_jmpbuf = -1;
[hjl@gnu-tools-1 nolto]$ cat y.i
int igt_subtest_jmpbuf = -2;
[hjl@gnu-tools-1 nolto]$ make
gcc-c -o main.o main.c
gcc -c  -o x.o x.i
gcc -c  -o y.o y.i
ar rcu -o libx.a x.o y.o
gcc  -o x main.o libx.a
gcc -fuse-ld=gold  -o y main.o libx.a
./x
igt_subtest_jmpbuf: -1
[hjl@gnu-tools-1 nolto]$ ./y
igt_subtest_jmpbuf: 0
[hjl@gnu-tools-1 nolto]$

-- 
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/23079] Multiple PREVAILING_DEF_IRONLY for a same symbol in an archive

2018-04-18 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=23079

--- Comment #6 from H.J. Lu  ---
Created attachment 10960
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10960&action=edit
A patch

Try this.

-- 
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/23079] Multiple PREVAILING_DEF_IRONLY for a same symbol in an archive

2018-04-18 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=23079

H.J. Lu  changed:

   What|Removed |Added

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

--- Comment #7 from H.J. Lu  ---
(In reply to Jan Hubicka from comment #3)
> Thanks for isolating this! The diagnostics is new in GCC 8. We may silence
> it if we agree that choosing random prevailing variant is way to go.
> 

GCC should silence multiple PREVAILING_DEF_IRONLY defs error on COMMON
symbols since it isn't error.

-- 
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/22537] Segmentation fault with static PIE

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

Alan Modra  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||amodra at gmail dot com
   Assignee|unassigned at sourceware dot org   |amodra 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 ld/22537] Segmentation fault with static PIE

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

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

commit f6a8b8c7ac2d5369070a6b76a94ee0f3052433ff
Author: Alan Modra 
Date:   Thu Apr 19 14:13:41 2018 +0930

PR22537, Segmentation fault with static PIE

The only stub type that makes sense for undefined symbols, or those
defined in shared libraries, is a plt call stub.  This patch arranges
to have "destination" set to -1 on such symbols, making for an easy
test in hppa_type_of_stub.

PR 22537
* elf32-hppa.c (elf32_hppa_size_stubs): Init "destination" to -1.
(hppa_type_of_stub): Don't return a long branch stub for
symbols other than those defined statically.

-- 
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/22537] Segmentation fault with static PIE

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

Alan Modra  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 CC|amodra at gmail dot com|
 Resolution|--- |FIXED

--- Comment #2 from Alan Modra  ---
Should be 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