[Bug binutils/15835] binutils can't deal with more than one SHT_SYMTAB_SHNDX section (such as from Solaris or illumos link editor)

2015-09-23 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=15835

--- Comment #19 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=6a40cf0c5c845683fdb82721813ebd5dd867cce5

commit 6a40cf0c5c845683fdb82721813ebd5dd867cce5
Author: Nick Clifton 
Date:   Wed Sep 23 17:23:58 2015 +0100

Add support for files that contain multiple symbol index tables.  Fixes PR
15835

binutilsPR binutils/15835
* readelf.c (struct elf_section_list): New structure.
(symtab_shndx_hdr): Replace with symtab_shndx_list.
(get_32bit_elf_symbols): Scan for a symbol index table matching
the symbol table in use.
(get_64bit_elf_symbols): Likewise.
(process_section_headers): Handle multiple symbol index sections.

bfd * elf-bfd.h (struct elf_section_list): New structure.
(struct elf_obj_tdata): Replace symtab_shndx_hdr with
symtab_shndx_list.  Delete symtab_shndx_section.
(elf_symtab_shndx): Replace macro with elf_symtab_shndx_list.
* elf.c (bfd_elf_get_syms): If symtab index sections are present,
scan them for the section that matches the provided symbol table.
(bfd_section_from_shdr): Record all SHT_SYMTAB_SHNDX sections.
(assign_section_numbers): Use the first symtab index table in the
list.
(_bfd_elf_compute_section_file_positions): Replace use of
symtab_shndx_hdr with use of symtab_shndx_list.
(find_section_in_list): New function.
(assign_file_postions_except_relocs): Use new function.
(_bfd_elf_copy_private_symbol_data): Likewise.
(swap_out_syms): Handle multiple symbol table index sections.
* elf32-m32c.c (m32c_elf_relax_section): Replace use of
symtab_shndx_hdr with use of symtab_shndx_list.
* elf32-rl78.c (rl78_elf_relax_section): Likewise.
* elf32-rx.c (rx_relax_section): Likewise.
* elf32-v850.c (v850_elf_relax_delete_bytes): Likewise.
* elflink.c (bfd_elf_final_link): 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/15835] binutils can't deal with more than one SHT_SYMTAB_SHNDX section (such as from Solaris or illumos link editor)

2015-09-23 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=15835

Nick Clifton  changed:

   What|Removed |Added

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

--- Comment #20 from Nick Clifton  ---
Patch checked in.

Cheers
  Nick

bfd/ChangeLog
2015-09-23  Nick Clifton  

PR binutils/15835
* elf-bfd.h (struct elf_section_list): New structure.
(struct elf_obj_tdata): Replace symtab_shndx_hdr with
symtab_shndx_list.  Delete symtab_shndx_section.
(elf_symtab_shndx): Replace macro with elf_symtab_shndx_list.
* elf.c (bfd_elf_get_syms): If symtab index sections are present,
scan them for the section that matches the provided symbol table.
(bfd_section_from_shdr): Record all SHT_SYMTAB_SHNDX sections.
(assign_section_numbers): Use the first symtab index table in the
list.
(_bfd_elf_compute_section_file_positions): Replace use of
symtab_shndx_hdr with use of symtab_shndx_list.
(find_section_in_list): New function.
(assign_file_postions_except_relocs): Use new function.
(_bfd_elf_copy_private_symbol_data): Likewise.
(swap_out_syms): Handle multiple symbol table index sections.
* elf32-m32c.c (m32c_elf_relax_section): Replace use of
symtab_shndx_hdr with use of symtab_shndx_list.
* elf32-rl78.c (rl78_elf_relax_section): Likewise.
* elf32-rx.c (rx_relax_section): Likewise.
* elf32-v850.c (v850_elf_relax_delete_bytes): Likewise.
* elflink.c (bfd_elf_final_link): Likewise.

binutils/ChangeLog
2015-09-23  Nick Clifton  

PR binutils/15835
* readelf.c (struct elf_section_list): New structure.
(symtab_shndx_hdr): Replace with symtab_shndx_list.
(get_32bit_elf_symbols): Scan for a symbol index table matching
the symbol table in use.
(get_64bit_elf_symbols): Likewise.
(process_section_headers): Handle multiple symbol index 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 binutils/18995] c++filt segfault on line not containing a symbol

2015-09-23 Thread michael at slashhome dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=18995

--- Comment #1 from Michael Leuchtenburg  ---
Unlikely to be relevant, but this is on Ubuntu vivid (15.04). No downstream bug
filed as yet.

-- 
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/18992] Linking a library implicitly using relative DT_RPATH does not work

2015-09-23 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=18992

Alan Modra  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2015-09-23
 CC||amodra at gmail dot com
 Ever confirmed|0   |1

--- Comment #4 from Alan Modra  ---
This will be because your linker is configured with a sysroot, and is
prepending the sysroot to relative paths.  I'm guessing --with-sysroot=/

-- 
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/18992] Linking a library implicitly using relative DT_RPATH does not work

2015-09-23 Thread sourceware-bugzilla at jbeekman dot nl
https://sourceware.org/bugzilla/show_bug.cgi?id=18992

--- Comment #5 from Jethro Beekman  ---
This indeed seems to be the case. In particular, on Ubuntu 14.04, this patch is
not applied:
http://apt-browse.org/browse/debian/wheezy/main/all/binutils-source/2.22-8/file/usr/src/binutils/patches/158_ld_system_root.patch
. It is applied on all other versions of Debian/Ubuntu I have tested. On all
these OS'es, the linker is invoked with --sysroot=/ but it only has any effect
on Ubuntu 14.04, and from the strace log I can indeed see that the linker tries
to access /dir/liba.so.

I don't think the sysroot should be prepended to relative paths. Here's a patch
to fix:

diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index 682f5e5..a70b138 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -1282,9 +1282,12 @@ fragment name);
+ char *tmpname = NULL, *name;
+ if (rp->name[0] == '/')
+   tmpname = gld${EMULATION_NAME}_add_sysroot (rp->name);
+ name = tmpname ? tmpname : rp->name;
  found = (rp->by == l->by
-  && gld${EMULATION_NAME}_search_needed (tmpname,
+  && gld${EMULATION_NAME}_search_needed (name,
  ,
  force));
  free (tmpname);

-- 
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/18995] New: c++filt segfault on line not containing a symbol

2015-09-23 Thread michael at slashhome dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=18995

Bug ID: 18995
   Summary: c++filt segfault on line not containing a symbol
   Product: binutils
   Version: 2.25
Status: NEW
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: michael at slashhome dot org
  Target Milestone: ---

c++filt -t <<< "# Event count (approx.): 746034049125"
segfault

Does not happen without -t.

Not-very-useful backtrace since I just have a stripped binary:
#0  0x7f1a38c3337c in ?? () from /usr/lib/libbfd-2.25-system.so
#1  0x7f1a38c347c8 in ?? () from /usr/lib/libbfd-2.25-system.so
#2  0x7f1a38c32875 in cplus_demangle_type () from
/usr/lib/libbfd-2.25-system.so
#3  0x7f1a38c357a8 in ?? () from /usr/lib/libbfd-2.25-system.so
#4  0x7f1a38c35a49 in ?? () from /usr/lib/libbfd-2.25-system.so
#5  0x7f1a38c35bcc in cplus_demangle_v3 () from
/usr/lib/libbfd-2.25-system.so
#6  0x7f1a38c2726e in cplus_demangle () from /usr/lib/libbfd-2.25-system.so
#7  0x00401ff2 in ?? ()
#8  0x00401d06 in ?? ()
#9  0x7f1a387a8a40 in __libc_start_main (main=0x401ab0, argc=2,
argv=0x7ffde376c1d8, init=, fini=,
rtld_fini=, stack_end=0x7ffde376c1c8) at libc-start.c:289
#10 0x00401da9 in ?? ()

-- 
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/18995] c++filt segfault on line not containing a symbol

2015-09-23 Thread ian at airs dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=18995

Ian Lance Taylor  changed:

   What|Removed |Added

 CC||ian at airs dot com

--- Comment #2 from Ian Lance Taylor  ---
I expect this is fixed on mainline by
https://gcc.gnu.org/ml/gcc-patches/2015-07/msg00399.html (which is not the
version of the patch that was actually checked in, but I think the patch that
was checked in fixed this 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 binutils/18998] New: Please enable -Wno-unknown-warning-option when compiling under Clang

2015-09-23 Thread noloader at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=18998

Bug ID: 18998
   Summary: Please enable -Wno-unknown-warning-option when
compiling under Clang
   Product: binutils
   Version: 2.26 (HEAD)
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: noloader at gmail dot com
  Target Milestone: ---

Clang does not understand a few warnings used by GCC. Combined with -Werror,
this results in a failed compile.

I understand I can perform the following, but this seems like one of those
things that could be easily automated:

export CFLAGS="-g2 -O2 -Wno-unknown-warning-option"

Here's what GCC reports under OS X 10.8.5:

$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr
--with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin12.6.0
Thread model: posix

-- 
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 admin/18997] Please enable AS and LD in configure.ac for OS X

2015-09-23 Thread noloader at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=18997

Jeffrey Walton  changed:

   What|Removed |Added

Version|unspecified |2.26 (HEAD)

-- 
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 admin/18997] Please enable AS and LD in configure.ac for OS X

2015-09-23 Thread noloader at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=18997

Jeffrey Walton  changed:

   What|Removed |Added

 CC||noloader 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/18992] Linking a library implicitly using relative DT_RPATH does not work

2015-09-23 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=18992

Alan Modra  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   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 admin/18997] New: Please enable AS and LD in configure.ac for OS X

2015-09-23 Thread noloader at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=18997

Bug ID: 18997
   Summary: Please enable AS and LD in configure.ac for OS X
   Product: binutils
   Version: unspecified
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: admin
  Assignee: unassigned at sourceware dot org
  Reporter: noloader at gmail dot com
  Target Milestone: ---

According to a checkout of the latest binutil sources from Git:

  $ grep -n "noconfigdirs" configure.ac | grep "ld gas"
  1015:noconfigdirs="$noconfigdirs ld gas gdb gprof"
  1023:noconfigdirs="$noconfigdirs ld gas gprof"
  1027:noconfigdirs="$noconfigdirs ld gas gdb gprof"
  1245:noconfigdirs="$noconfigdirs ld gas gprof target-libgloss"
  1251:noconfigdirs="$noconfigdirs ld gas gprof"

And from the cluster at 1015/1023/1027:

  i[[3456789]]86-*-darwin*)
noconfigdirs="$noconfigdirs ld gprof"
noconfigdirs="$noconfigdirs sim target-rda"
;;
  x86_64-*-darwin[[912]]*)
noconfigdirs="$noconfigdirs ld gas gprof"
noconfigdirs="$noconfigdirs sim target-rda"
;;
  *-*-darwin*)
noconfigdirs="$noconfigdirs ld gas gdb gprof"
noconfigdirs="$noconfigdirs sim target-rda"
;;

>From above, notice GAS is enabled for i386|i686, but not x86_64.

Downstream providers, like Macports, do not provide them stating its an
upstream problem. Confer, "Where is AS located after Binutils is installed?",
https://lists.macosforge.org/pipermail/macports-users/2015-April/038397.html.

I would like to ask that Binutils provide both LD and AS for OS X. Enabling LD
and AS will benefit users, and get downstream providers like Macports involved
in enhancing the utilities.

***

Here's some related information.

Our project provides both C/C++ code and alternate inline assembly (both
one-liners and blocks). The ASM code is never used on OS X because of OS X's
down-level assembler, even when contemporary gear (like a modern GCC via
Macports) is available.

Clang is not always an alternative for OS X. For example, Clang and its
integrated assembler cannot consume some basic ASM statements, like a negate.
Confer, https://llvm.org/bugs/show_bug.cgi?id=24232.

GCC manages to work around many|most issues with Apple platforms. For example,
init_priorty is not available on OS X. GCC chooses to make init_priorty an
compiler error rather than not providing the compiler on OS X.

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