[Bug gas/20648] New: over cautious .cfi_sections consistency check

2016-09-29 Thread mpf at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=20648

Bug ID: 20648
   Summary: over cautious .cfi_sections consistency check
   Product: binutils
   Version: 2.28 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: gas
  Assignee: unassigned at sourceware dot org
  Reporter: mpf at gcc dot gnu.org
  Target Milestone: ---

Created attachment 9538
  --> https://sourceware.org/bugzilla/attachment.cgi?id=9538&action=edit
Proposed patch

.cfi_sections had consistency checking added as part of support for new compact
eh_frame sections.  The original check was simply to disallow any variation in
the sections specified when multiple .cfi_sections directives were seen.  This
caused some issues as the directive is supposed to allow additional sections to
be listed via multiple instances.

As it happens the original compact eh support did not actually prevent
switching to the compact form if the first .cfi_sections came after the first
CFI data:

.cfi_startproc
.cfi_sections .eh_frame_entry
.cfi_endproc

The fix for PR gas/19614 fixed both the issues above but ended up still left
the consistency check more aggressive that it needs to be.

For background... the need for the consistency check comes from the change in
behavior of all the other .cfi* directives depending on whether the original or
compact form of eh_frame is to be generated.

Other non-GCC users of gas however now face a change in behavior that is not
technically necessary. I.e. llvm as per
https://llvm.org/bugs/show_bug.cgi?id=29017.

A reasonable fix would be to make the consistency check specifically about the
one problem case where one turns on compact EH after emitting CFI data. This
could be done by looking at the compact_eh global changing from false to true
(when cfi_sections_set is true) but that would allow the following which may be
misleading:

.cfi_sections .eh_frame_entry
.cfi_startproc
.cfi_sections .eh_frame
.cfi_endproc

I.e. the use of .eh_frame may mean a user expects the non-compact form.

Instead we can check if a new .cfi_sections specifies either of .eh_frame or
.eh_frame_entry and if so verifies whether this is now different from what was
there before.  Specifically it means the testcase directly above is rejected
and the one below is accepted:

.cfi_sections .eh_frame
.cfi_startproc
.cfi_sections .debug_frame
.cfi_endproc

-- 
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/20649] New: [MIPS] Can't find matching LO16 reloc

2016-09-29 Thread james410 at cowgill dot org.uk
https://sourceware.org/bugzilla/show_bug.cgi?id=20649

Bug ID: 20649
   Summary: [MIPS] Can't find matching LO16 reloc
   Product: binutils
   Version: 2.27
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: gas
  Assignee: unassigned at sourceware dot org
  Reporter: james410 at cowgill dot org.uk
  Target Milestone: ---

Created attachment 9540
  --> https://sourceware.org/bugzilla/attachment.cgi?id=9540&action=edit
src.cpp

Debian bug: https://bugs.debian.org/834147
Moved from GCC: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77300

When compiling the attached testcase with:
 mipsel-linux-gnu-g++-6 -O2 -fPIC src.cpp

I get:
/usr/lib/gcc-cross/mipsel-linux-gnu/6/../../../../mipsel-linux-gnu/bin/ld:
/tmp/ccqVuMV3.o: Can't find matching LO16 reloc against
`_ZN1HIiE5m_fn4ERK1G.isra.1' for R_MIPS_GOT16 at 0xcc in section
`.text._ZN1HIiE5m_fn5ERK1G[_ZN1HIiE5m_fn5ERK1G]'

Originally I thought this was a bug in how GCC generates GOT16 relocations but
it turns out it's probably a bug in GAS instead.

See the GCC bug for more information.

-- 
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/20649] [MIPS] Can't find matching LO16 reloc

2016-09-29 Thread james410 at cowgill dot org.uk
https://sourceware.org/bugzilla/show_bug.cgi?id=20649

--- Comment #1 from James Cowgill  ---
Created attachment 9541
  --> https://sourceware.org/bugzilla/attachment.cgi?id=9541&action=edit
src.s

Assembly output from compiling the testcase with:
 mipsel-linux-gnu-g++-6 -O2 -fPIC -S src.cpp

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


Infinite recursion in binutils 2.27 (ld, gdb, c++filt)

2016-09-29 Thread Matthieu Monrocq
Hello,


We are hitting an infinite recursion in "ld", eventually leading to a 
stackoverflow and segfault, when using the --version-script option with a C++ 
symbol (which "forces" ld to demangle symbols).


This bug also affects our versions of c++filt and gdb.



Commands used:


$ /opt/imc/gcc-6.2.0/bin/g++ -fPIC -std=c++14 -O3 -ggdb -o main.cpp.o -c 
main.cpp

$ /opt/imc/gcc-6.2.0/bin/g++ -fPIC -std=c++14 -shared -o libCrash.so main.cpp.o 
-Wl,--version-script=simple.map
collect2: fatal error: ld terminated with signal 11 [Segmentation fault]
compilation terminated.



And:


$ c++filt 
_ZSt7forwardIRP22XxxxXxxXxxI28XxxxXxxxXxxxXxxxXxxxZN3TBQ26XxxxXxxxXxxxXxINS2_14TBQXxxxXxxINS2_8TBQXINS2_12XxXxxXxxINS2_15XxxxXxxEEENS2_10TBQXxxEE5xEvEUlRT_RT0_PT1_E_Z28xxXxxxXxxXxxIS1_SJ_ESt10unique_ptrI31XxxxXxxXxxXISD_ESt14default_deleteISN_EESF_EUlR5XE_ZSK_IS1_SJ_ESQ_SF_EUlvE0_EEOSD_RNSt16remove_referenceISD_E4typeE
Segmentation fault



Versions used:


$ cat /etc/centos-release
CentOS Linux release 7.2.1511 (Core)


$ /opt/imc/gcc-6.2.0/bin/g++ --version
g++ (GCC) 6.2.0


$ c++filt --version
GNU c++filt version 2.23.52.0.1-55.el7 20130226


$ /opt/imc/gcc-6.2.0/bin/ld --version
GNU ld (GNU Binutils) 2.27


$ gdb --version
GNU gdb (GDB) Red Hat Enterprise Linux 7.10.50.20151113-33.el7



Notes:

The symbols reported in those bug reports do not crash my c++filt:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61233

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61460

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61805

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72822


However the symbol reported in this one does crash c++filt (although not ld):

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70909


Kind Regards,

Matthieu Monrocq

IMC financial markets | Strawinskylaan 377, WTC D-tower, 1077 XX Amsterdam | 
www.imc.com
P +31 (0)20 798 8601 | E matthieu.monr...@imc.com



The information in this e-mail is intended only for the person or entity to 
which it is addressed.

It may contain confidential and /or privileged material. If someone other than 
the intended recipient should receive this e-mail, he / she shall not be 
entitled to read, disseminate, disclose or duplicate it.

If you receive this e-mail unintentionally, please inform us immediately by 
"reply" and then delete it from your system. Although this information has been 
compiled with great care, neither IMC Financial Markets & Asset Management nor 
any of its related entities shall accept any responsibility for any errors, 
omissions or other inaccuracies in this information or for the consequences 
thereof, nor shall it be bound in any way by the contents of this e-mail or its 
attachments. In the event of incomplete or incorrect transmission, please 
return the e-mail to the sender and permanently delete this message and any 
attachments.

Messages and attachments are scanned for all known viruses. Always scan 
attachments before opening them.
#include 

extern "C" {
void _ZSt7forwardIRP22XxxxXxxXxxI28XxxxXxxxXxxxXxxxXxxxZN3TBQ26XxxxXxxxXxxxXxINS2_14TBQXxxxXxxINS2_8TBQXINS2_12XxXxxXxxINS2_15XxxxXxxEEENS2_10TBQXxxEE5xEvEUlRT_RT0_PT1_E_Z28xxXxxxXxxXxxIS1_SJ_ESt10unique_ptrI31XxxxXxxXxxXISD_ESt14default_deleteISN_EESF_EUlR5XE_ZSK_IS1_SJ_ESQ_SF_EUlvE0_EEOSD_RNSt16remove_referenceISD_E4typeE() {
std::cout << "Hello, World\n";
}
}

int main() {
_ZSt7forwardIRP22XxxxXxxXxxI28XxxxXxxxXxxxXxxxXxxxZN3TBQ26XxxxXxxxXxxxXxINS2_14TBQXxxxXxxINS2_8TBQXINS2_12XxXxxXxxINS2_15XxxxXxxEEENS2_10TBQXxxEE5xEvEUlRT_RT0_PT1_E_Z28xxXxxxXxxXxxIS1_SJ_ESt10unique_ptrI31XxxxXxxXxxXISD_ESt14default_deleteISN_EESF_EUlR5XE_ZSK_IS1_SJ_ESQ_SF_EUlvE0_EEOSD_RNSt16remove_referenceISD_E4typeE();
}

{ global:
  extern "C++" {
__wrap_memcpy;
  };
  local: *;
};
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/20650] New: bug

2016-09-29 Thread jyothsna_bitla at yahoo dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20650

Bug ID: 20650
   Summary: bug
   Product: binutils
   Version: 2.13
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: gas
  Assignee: unassigned at sourceware dot org
  Reporter: jyothsna_bitla at yahoo dot com
  Target Milestone: ---

-- 
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/20651] New: its a minor bug

2016-09-29 Thread jyothsna_bitla at yahoo dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20651

Bug ID: 20651
   Summary: its a minor bug
   Product: binutils
   Version: 2.12
Status: UNCONFIRMED
  Severity: minor
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: jyothsna_bitla at yahoo dot com
  Target Milestone: ---

-- 
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/20651] its a minor bug

2016-09-29 Thread jyothsna_bitla at yahoo dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20651

jyothsna_bitla at yahoo dot com changed:

   What|Removed |Added

   Priority|P2  |P3

-- 
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/20528] ld -r doesn't handle SHF_EXCLUDE section properly

2016-09-29 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=20528

--- Comment #3 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=93dc595d7659a8cf224a9fc33aa9071f38328334

commit 93dc595d7659a8cf224a9fc33aa9071f38328334
Author: H.J. Lu 
Date:   Thu Sep 29 12:58:29 2016 -0700

Don't merge 2 sections with different SHF_EXCLUDE

SEC_EXCLUDE is ignored when doing a relocatable link.  But we can't
merge 2 input sections with the same name when only one of them has
SHF_EXCLUDE.

PR ld/20528
* emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Don't
merge 2 sections with different SHF_EXCLUDE.
* testsuite/ld-elf/pr20528a.d: New file.
* testsuite/ld-elf/pr20528a.s: Likewise.
* testsuite/ld-elf/pr20528b.d: Likewise.
* testsuite/ld-elf/pr20528b.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 ld/20528] ld -r doesn't handle SHF_EXCLUDE section properly

2016-09-29 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20528

H.J. Lu  changed:

   What|Removed |Added

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

--- Comment #4 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 gas/20641] powerpc: Should not allow three-operand cmp[l][i]

2016-09-29 Thread bergner at vnet dot ibm.com
https://sourceware.org/bugzilla/show_bug.cgi?id=20641

--- Comment #6 from Peter Bergner  ---
FYI, I just committed a fix to the gdb testsuite to account for these changes.

* gdb.arch/powerpc-power.exp : Update tests to account for
the compulsory L operand changes.
* gdb.arch/powerpc-power.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 gprof/20656] double assignment in source.c

2016-09-29 Thread tromey at sourceware dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=20656

Tom Tromey  changed:

   What|Removed |Added

 Blocks||20613


Referenced Bugs:

https://sourceware.org/bugzilla/show_bug.cgi?id=20613
[Bug 20613] GDB - a tough nut to crack: only a few bugs found by PVS-Studio
-- 
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/20656] New: double assignment in source.c

2016-09-29 Thread tromey at sourceware dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=20656

Bug ID: 20656
   Summary: double assignment in source.c
   Product: binutils
   Version: unspecified
Status: NEW
  Severity: normal
  Priority: P2
 Component: gprof
  Assignee: unassigned at sourceware dot org
  Reporter: tromey at sourceware dot org
  Target Milestone: ---

This comes from bug 20613 and http://www.viva64.com/en/b/0430/

source.c has:

  if (new_line)
{
  (*annote) (annotation, max_width, line_num, arg);
  fputs (annotation, ofp);
  ++line_num;
  new_line = FALSE;
}

  new_line = (buf[i] == '\n');

The first assignment to new_line is redundant here.
Or maybe there is a missing "else".  I didn't read closely.

-- 
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/20657] New: buglet in putop() in opcodes/i386-dis.c

2016-09-29 Thread tromey at sourceware dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=20657

Bug ID: 20657
   Summary: buglet in putop() in opcodes/i386-dis.c
   Product: binutils
   Version: unspecified
Status: NEW
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: tromey at sourceware dot org
  Target Milestone: ---

This comes from bug 20613 and http://www.viva64.com/en/b/0430/

Here:

case '{':
  alt = 0;
  if (intel_syntax)
{
  while (*++p != '|')
if (*p == '}' || *p == '\0')
  abort ();
}
  /* Fall through.  */
case 'I':
  alt = 1;
  continue;

Either "alt" is assigned twice in succession (in which case the
first assignment could be moved into the "if"), or else the fall-through
is incorrect.

-- 
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/20657] buglet in putop() in opcodes/i386-dis.c

2016-09-29 Thread tromey at sourceware dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=20657

Tom Tromey  changed:

   What|Removed |Added

 Blocks||20613


Referenced Bugs:

https://sourceware.org/bugzilla/show_bug.cgi?id=20613
[Bug 20613] GDB - a tough nut to crack: only a few bugs found by PVS-Studio
-- 
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/20649] [MIPS] Can't find matching LO16 reloc

2016-09-29 Thread ma...@linux-mips.org
https://sourceware.org/bugzilla/show_bug.cgi?id=20649

Maciej W. Rozycki  changed:

   What|Removed |Added

 CC||ma...@linux-mips.org

--- Comment #2 from Maciej W. Rozycki  ---
Created attachment 9544
  --> https://sourceware.org/bugzilla/attachment.cgi?id=9544&action=edit
Intended bug fix

Thank you for your bug report.

I have looked into this problem and it looks like a GAS regression to
me, albeit a very old one.  It was introduced with commit 861467f9,
which unfortunately was bundled with an unrelated change, made with no
discussion or justification posted, had no test case included, and only
a terse notification was sent afterwards ("Traditional MIPS patches"),
.

It made symbols in linkonce or what is these days known as comdat
sections to be treated as external for the purpose of PIC relocation
generation even if their binding remains STB_LOCAL.  This in turn
disabled GOT16/LO16 relocation pairing as no complementing LO16
relocation is expected for external GOT16 references in the o32 ABI.

Please try the patch attached which seems to fix the issue for me and
causes no regressions in `mips-linux-gnu' binutils testing.  I'll be
committing it as soon as I have suitable test cases made and it has
passed full regression testing across the relevant targets.

NB GCC has done a pretty decent job here as in actual code execution
the GOT16 reference just below $L15 is actually paired with the
complementing LO16 reference at $L17 as it's in a delay slot of a
branch going to the latter location.  So the GOT16 reference is not
orphan even though it is duplicate from the ELF file's point of view.

gas/
* config/tc-mips.c (pic_need_relax): Don't check for linkonce
symbols, remove the `segtype' parameter.
(mips_frob_file, md_estimate_size_before_relax): Adjust
accordingly.
(s_is_linkonce): Add an explanatory comment.

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