[Bug binutils/21479] strip doesn't handle lto archives

2025-05-06 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21479

--- Comment #14 from H.J. Lu  ---
(In reply to Sam James from comment #13)
> For the non-fat case, we get:
> 
> a.c
> ```
> extern void foo1(void);
> void foo2(void) { foo1(); }
> void foo3(void) {}
> ```
> 
> b.c:
> ```
> extern void foo2(void);
> extern void foo3(void);
> void foo1(void) { foo3(); }
> int main(void) { foo2(); }
> ```
> 
> $ gcc -c -flto a.c
> $ ar cr a.a a.o
> $ gcc b.c a.a
> $ strip -R .gnu.lto_* -R .gnu.debuglto_* -N __gnu_lto_v1 a.a
> strip: stt1ROFT/a.o: plugin needed to handle lto object

The BFD may issue such a message in the following places:

archive.c: (_("%pB: plugin needed to handle lto object"),
archive.c:(_("%pB: plugin needed to handle lto object"),
elflink.c:  (_("%pB: plugin needed to handle lto object"), abfd);
linker.c: (_("%pB: plugin needed to handle lto object"), abfd);

We can open a new bug report to improve the message after this bug has been
fixed.

> Maybe the message could be nicer or omitted even (don't think it serves much
> of a purpose, other than maybe informing people they're doing something
> stupid, as the archive which is non-fat is now useless).
> 
> But this isn't a problem for me at all either. Current behaviour is fine.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/21479] strip doesn't handle lto archives

2025-05-06 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=21479

--- Comment #13 from Sam James  ---
For the non-fat case, we get:

a.c
```
extern void foo1(void);
void foo2(void) { foo1(); }
void foo3(void) {}
```

b.c:
```
extern void foo2(void);
extern void foo3(void);
void foo1(void) { foo3(); }
int main(void) { foo2(); }
```

$ gcc -c -flto a.c
$ ar cr a.a a.o
$ gcc b.c a.a
$ strip -R .gnu.lto_* -R .gnu.debuglto_* -N __gnu_lto_v1 a.a
strip: stt1ROFT/a.o: plugin needed to handle lto object

Maybe the message could be nicer or omitted even (don't think it serves much of
a purpose, other than maybe informing people they're doing something stupid, as
the archive which is non-fat is now useless).

But this isn't a problem for me at all either. Current behaviour is fine.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/32809] readelf doesn't dump .debug_loclists section correctly for 64-bit target and mixed dwarf4/5 content

2025-05-06 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=32809

--- Comment #7 from Sourceware Commits  ---
The binutils-2_44-branch branch has been updated by H.J. Lu
:

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

commit 33578177adc8c04f2341548d63dbf00c03e188a2
Author: H.J. Lu 
Date:   Thu Mar 20 13:16:34 2025 -0700

dwarf: Dump .debug_loclists only for DWARF-5

.debug_loclists section is loaded into debug_information as DWARF-5 debug
info and .debug_loc section is loaded into debug_information as pre-DWARF-5
debug info.  When dumping .debug_loc section, we should only process
pre-DWARF-5 debug info in debug_information.  When dumping .debug_loclists
section, we should only process DWARF-5 info in debug_information.

binutils/

PR binutils/32809
* dwarf.c (display_debug_loc): Dump .debug_loclists only for
DWARF-5.

ld/

PR binutils/32809
* testsuite/ld-x86-64/dwarf4.s: New file.
* testsuite/ld-x86-64/dwarf5a.s: Likewise.
* testsuite/ld-x86-64/dwarf5b.s: Likewise.
* testsuite/ld-x86-64/pr32809.d: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run pr32809.

Signed-off-by: H.J. Lu 
(cherry picked from commit 82bdc396a40e64ea17acdba072bafbb3f620518f)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/32809] readelf doesn't dump .debug_loclists section correctly for 64-bit target and mixed dwarf4/5 content

2025-05-06 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=32809

--- Comment #8 from Sourceware Commits  ---
The binutils-2_43-branch branch has been updated by H.J. Lu
:

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

commit 4056b58ad334246840a81a4cac228863ea45b79d
Author: H.J. Lu 
Date:   Thu Mar 20 13:16:34 2025 -0700

dwarf: Dump .debug_loclists only for DWARF-5

.debug_loclists section is loaded into debug_information as DWARF-5 debug
info and .debug_loc section is loaded into debug_information as pre-DWARF-5
debug info.  When dumping .debug_loc section, we should only process
pre-DWARF-5 debug info in debug_information.  When dumping .debug_loclists
section, we should only process DWARF-5 info in debug_information.

binutils/

PR binutils/32809
* dwarf.c (display_debug_loc): Dump .debug_loclists only for
DWARF-5.

ld/

PR binutils/32809
* testsuite/ld-x86-64/dwarf4.s: New file.
* testsuite/ld-x86-64/dwarf5a.s: Likewise.
* testsuite/ld-x86-64/dwarf5b.s: Likewise.
* testsuite/ld-x86-64/pr32809.d: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run pr32809.

Signed-off-by: H.J. Lu 
(cherry picked from commit 82bdc396a40e64ea17acdba072bafbb3f620518f)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/32809] readelf doesn't dump .debug_loclists section correctly for 64-bit target and mixed dwarf4/5 content

2025-05-06 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=32809

--- Comment #9 from H.J. Lu  ---
Also fixed on 2.43 and 2.44 branches.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug gprofng/32943] libgprofng.so: undefined reference to `std::ios_base_library_init()'

2025-05-06 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=32943

Sam James  changed:

   What|Removed |Added

  Component|binutils|gprofng
   Assignee|unassigned at sourceware dot org   |vladimir.mezentsev at 
oracle dot c
   ||om

--- Comment #2 from Sam James  ---
Seems like your GCC is broken.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/32944] objdump (2.34) segfaults with option list "-x -d -r -t -p -S --dwarf=info,rawline,decodedline,frames,frames-interp,follow-links,Ranges,gdb_index,abbrev"

2025-05-06 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=32944

--- Comment #1 from Sam James  ---
Please try to reproduce this with binutils-2.44 or trunk. If it works there,
you'll need to report this to Ubuntu instead.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/32943] New: libgprofng.so: undefined reference to `std::ios_base_library_init()'

2025-05-06 Thread zohran.londais at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=32943

Bug ID: 32943
   Summary: libgprofng.so: undefined reference to
`std::ios_base_library_init()'
   Product: binutils
   Version: 2.43
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: zohran.londais at gmail dot com
  Target Milestone: ---

Created attachment 16073
  --> https://sourceware.org/bugzilla/attachment.cgi?id=16073&action=edit
Full build log

Hi guys, I am developing my own Linux distribution, I am working on a new kind
of package manager for Linux over 4 years now. I am seeking your help because
recently I started to face this issue when I try to build binutils 2.43.

Just to let you know, my package manager build everything from zero, it mean I
built before a cross toolchain. I guess the problem came from how I built the
cross toolchain, but I can't find where is the problem.

This is the error I get:

sr/lib/gcc/x86_64-unknown-linux-gnu/14.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld:
./.libs/libgprofng.so: undefined reference to `std::ios_base_library_init()'
/usr/lib/gcc/x86_64-unknown-linux-gnu/14.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld:
./.libs/libgprofng.so: undefined reference to `std::ios_base_library_init()'
collect2: error: ld returned 1 exit status
/usr/lib/gcc/x86_64-unknown-linux-gnu/14.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld:
./.libs/libgprofng.so: undefined reference to `std::ios_base_library_init()'
collect2: error: ld returned 1 exit status
collect2: error: ld returned 1 exit status
make[5]: *** [Makefile:696: gp-archive] Error 1
make[5]: *** Waiting for unfinished jobs
make[5]: *** [Makefile:712: gprofng] Error 1
make[5]: *** [Makefile:700: gp-collect-app] Error 1
/usr/lib/gcc/x86_64-unknown-linux-gnu/14.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld:
./.libs/libgprofng.so: undefined reference to `std::ios_base_library_init()'
collect2: error: ld returned 1 exit status
make[5]: *** [Makefile:704: gp-display-src] Error 1
make[4]: *** [Makefile:573: all] Error 2
make[5]: Leaving directory
'/sources/ProgrammingTools-Main/Binutils/2.43.0/Sources/mainBuild/gprofng/src'
make[4]: Leaving directory
'/sources/ProgrammingTools-Main/Binutils/2.43.0/Sources/mainBuild/gprofng/src'
make[3]: *** [Makefile:472: all-recursive] Error 1
make[3]: Leaving directory
'/sources/ProgrammingTools-Main/Binutils/2.43.0/Sources/mainBuild/gprofng'
make[2]: *** [Makefile:404: all] Error 2
make[2]: Leaving directory
'/sources/ProgrammingTools-Main/Binutils/2.43.0/Sources/mainBuild/gprofng'
make[1]: *** [Makefile:7658: all-gprofng] Error 2
make[1]: *** Waiting for unfinished jobs
  CXXLDld-new
  CXXLDincremental-dump
make[4]: Leaving directory
'/sources/ProgrammingTools-Main/Binutils/2.43.0/Sources/mainBuild/gold'
make[3]: Leaving directory
'/sources/ProgrammingTools-Main/Binutils/2.43.0/Sources/mainBuild/gold'
make[2]: Leaving directory
'/sources/ProgrammingTools-Main/Binutils/2.43.0/Sources/mainBuild/gold'
make[1]: Leaving directory
'/sources/ProgrammingTools-Main/Binutils/2.43.0/Sources/mainBuild'
make: *** [Makefile:1028: all] Error 2

[ [31mInstaller failure[0m ]

Class: [31mSoftware[0m
Function: [31mbuild[0m

[31mInstallation task failed[0m
The [35mbuild[0m process failed for [35m@ProgrammingTools-Main:Binutils[0m
/[38;2;255;100;100m2.43.0[0m/

Exception:
[31mNil assertion failed[0m

Exit code: [31m1[0m

[31m[31mISM raised that error because the ran script did not call properly a
system command or the system command itself need to be fix.[0m[0m

I will attach the full log.

By the way, the link to my project too:
https://github.com/fulgurance/ism

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/32944] New: objdump (2.34) segfaults with option list "-x -d -r -t -p -S --dwarf=info,rawline,decodedline,frames,frames-interp,follow-links,Ranges,gdb_index,abbrev"

2025-05-06 Thread arindam.sharma at imperial dot ac.uk
https://sourceware.org/bugzilla/show_bug.cgi?id=32944

Bug ID: 32944
   Summary: objdump (2.34) segfaults with option list "-x -d -r -t
-p -S
--dwarf=info,rawline,decodedline,frames,frames-interp,
follow-links,Ranges,gdb_index,abbrev"
   Product: binutils
   Version: unspecified
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: arindam.sharma at imperial dot ac.uk
  Target Milestone: ---

Created attachment 16074
  --> https://sourceware.org/bugzilla/attachment.cgi?id=16074&action=edit
Bug inducing file

A segfault appears with objdump 2.34 (shipping with ubuntu 20.04). I am also
attaching the bug-inducing file and following is the reproduction command. 

`objdump -x -d -r -t -p -S
--dwarf=info,rawline,decodedline,frames,frames-interp,follow-links,Ranges,gdb_index,abbrev
crasher`

Following is the full log of the bug as I run it with valgrind:

==845== Memcheck, a memory error detector
==845== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==845== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==845== Command: objdump -x -d -r -t -p -S
--dwarf=info,rawline,decodedline,frames,frames-interp,follow-links,Ranges,gdb_index,abbrev
crasher
==845== 
objdump: crasher: invalid string offset 16777216 >= 13 for section `.strtab'
objdump: crasher: invalid string offset 16777216 >= 13 for section `.strtab'
objdump: crasher(.debug_info): relocation 1 has invalid symbol index 241

Can't get contents for section '.debug_info'.

crasher: file format elf64-x86-64
crasher
architecture: i386:x86-64, flags 0x0011:
HAS_RELOC, HAS_SYMS
start address 0x

objdump: crasher: invalid string offset 16777216 >= 13 for section `.strtab'
Sections:
Idx Name  Size  VMA   LMA   File off  Algn
  0 .text 000f      0040  2**0
  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .data       004f  2**0
  CONTENTS, ALLOC, LOAD, DATA
  2 .bss        004f  2**0
  ALLOC
  3 .debug_info   0053      004f  2**0
  CONTENTS, RELOC, READONLY, DEBUGGING, OCTETS
  4 .debug_abbrev 0039      00a2  2**0
  CONTENTS, READONLY, DEBUGGING, OCTETS
  5 .debug_aranges 0030      00db  2**0
  CONTENTS, RELOC, READONLY, DEBUGGING, OCTETS
  6 .debug_line   003d      010b  2**0
  CONTENTS, RELOC, READONLY, DEBUGGING, OCTETS
  7 .debug_str0093      0148  2**0
  CONTENTS, READONLY, DEBUGGING, OCTETS
  8 .comment  002c      01db  2**0
  CONTENTS, READONLY
  9 .note.GNU-stack       0207 
2**0
  CONTENTS, READONLY
 10 .note.gnu.property 0020      0208 
2**3
  CONTENTS, ALLOC, LOAD, READONLY, DATA
 11 .eh_frame 0038      0228  2**3
  CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
SYMBOL TABLE:
 ldf *ABS*   main.c
 ld  .text   .text
 ld  .data   .data
 ld  .bss    .bss
 ld  .debug_info (null)
 ld  .debug_abbrev   .debug_abbrev
 ld  .debug_aranges  .debug_aranges
 ld  .debug_line .debug_line
 ld  .debug_str  .debug_str
 ld  .note.GNU-stack
.note.GNU-stack
 ld  .note.gnu.property 
.note.gnu.property
 ld  .eh_frame   .eh_frame
 ld  .comment    .comment
 g F .text  000f main



Can't get contents for section '.debug_info'.
Contents of the .debug_abbrev section:

  Number TAG (0x0)
   1  DW_TAG_compile_unit[has children]
DW_AT_producer DW_FORM_strp
DW_AT_language DW_FORM_data1
DW_AT_name DW_FORM_ref_sup8
DW_AT_comp_dir DW_FORM_strp
DW_AT_low_pc   DW_FORM_addr
DW_AT_high_pc  DW_FORM_data8
DW_AT_stmt_listDW_FORM_sec_offset
DW_AT value: 0 DW_FORM value: 0
   2  DW_TAG_sub

[Bug binutils/32944] objdump (2.34) segfaults with option list "-x -d -r -t -p -S --dwarf=info,rawline,decodedline,frames,frames-interp,follow-links,Ranges,gdb_index,abbrev"

2025-05-06 Thread arindam.sharma at imperial dot ac.uk
https://sourceware.org/bugzilla/show_bug.cgi?id=32944

Sharma, Arindam  changed:

   What|Removed |Added

 CC||arindam.sharma at imperial dot 
ac.
   ||uk

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/32943] libgprofng.so: undefined reference to `std::ios_base_library_init()'

2025-05-06 Thread zohran.londais at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=32943

--- Comment #1 from Zohran Londais  ---
The thing strange is if I disable gprofng, binutils build.

So what need gprofng to compile properly ?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/32944] objdump (2.34) segfaults with option list "-x -d -r -t -p -S --dwarf=info,rawline,decodedline,frames,frames-interp,follow-links,Ranges,gdb_index,abbrev"

2025-05-06 Thread arindam.sharma at imperial dot ac.uk
https://sourceware.org/bugzilla/show_bug.cgi?id=32944

--- Comment #2 from Sharma, Arindam  ---
It works there, so I will try and report this to ubuntu. 
Thanks for the help.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug gprofng/32943] libgprofng.so: undefined reference to `std::ios_base_library_init()'

2025-05-06 Thread vladimir.mezentsev at oracle dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=32943

--- Comment #3 from Vladimir Mezentsev  
---
 It looks like c++ libraries are absent.
Try:
 sudo apt-get install g++-multilib


Or maybe it runs the gcc linker instead of g++.
Try to add -lstdc++ :
 libtool: link: g++ -Wall -pthread -Wno-switch -g -O2 -o .libs/gprofng
gprofng.o  ./.libs/libgprofng.so
-L/sources/ProgrammingTools-Main/Binutils/2.43.0/Sources/mainBuild/bfd/../libiberty/pic
-L/sources/ProgrammingTools-Main/Binutils/2.43.0/Sources/mainBuild/opcodes/../libiberty/pic
-L/sources/ProgrammingTools-Main/Binutils/2.43.0/Sources/mainBuild/libiberty/pic
/sources/ProgrammingTools-Main/Binutils/2.43.0/Sources/mainBuild/opcodes/.libs/libopcodes.so
/sources/ProgrammingTools-Main/Binutils/2.43.0/Sources/mainBuild/bfd/.libs/libbfd.so
/sources/ProgrammingTools-Main/Binutils/2.43.0/Sources/mainBuild/libsframe/.libs/libsframe.so
-liberty -lpthread -ldl -lz -pthread

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/32944] objdump (2.34) segfaults with option list "-x -d -r -t -p -S --dwarf=info,rawline,decodedline,frames,frames-interp,follow-links,Ranges,gdb_index,abbrev"

2025-05-06 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=32944

Alan Modra  changed:

   What|Removed |Added

 Resolution|--- |OBSOLETE
 Status|UNCONFIRMED |RESOLVED
Version|unspecified |2.34

--- Comment #3 from Alan Modra  ---
Fuzzed object file testcase.

-- 
You are receiving this mail because:
You are on the CC list for the bug.