[Bug binutils/29718] readelf prints out ": 10" instead of "IFUNC"

2022-10-25 Thread mliska at suse dot cz
https://sourceware.org/bugzilla/show_bug.cgi?id=29718

Martin Liska  changed:

   What|Removed |Added

 CC||mjw at fedoraproject dot org

--- Comment #1 from Martin Liska  ---
Looking into readelf, I see the ident[EI_OSABI] == 0, thus it can be fixed
with:

diff --git a/libebl/eblsymboltypename.c b/libebl/eblsymboltypename.c
index 0ff1722a..a5db53b0 100644
--- a/libebl/eblsymboltypename.c
+++ b/libebl/eblsymboltypename.c
@@ -65,8 +65,7 @@ ebl_symbol_type_name (Ebl *ebl, int symbol, char *buf, size_t
len)
snprintf (buf, len, "LOPROC+%d", symbol - STT_LOPROC);
  else if (symbol == STT_GNU_IFUNC
   && ebl != NULL
-  && (ident = elf_getident (ebl->elf, NULL)) != NULL
-  && ident[EI_OSABI] == ELFOSABI_LINUX)
+  && (ident = elf_getident (ebl->elf, NULL)) != NULL)
return "GNU_IFUNC";
  else if (symbol >= STT_LOOS && symbol <= STT_HIOS)
snprintf (buf, len, "LOOS+%d", symbol - STT_LOOS);

and one gets then:

./src/readelf -s /home/marxin/Programming/testcases/a.out | grep strcmp
2:   0 GNU_IFUNC GLOBAL DEFAULTUNDEF
strcmp@GLIBC_2.2.5 (2)

@Mark: What do you think about such a change?

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


[Bug binutils/29720] New: objdump -S crashes if build-id is missing

2022-10-25 Thread mliska at suse dot cz
https://sourceware.org/bugzilla/show_bug.cgi?id=29720

Bug ID: 29720
   Summary: objdump -S crashes if build-id is missing
   Product: binutils
   Version: 2.40 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: mliska at suse dot cz
CC: amerey at redhat dot com
  Target Milestone: ---

As a consequence of the implement PR29075, I see the following crash:

$ gcc a.c -Wl,--build-id=none
$ ./binutils/objdump -S ~/Programming/testcases/a.out

/home/marxin/Programming/testcases/a.out: file format elf64-x86-64


Disassembly of section .init:

00401000 <_init>:
Segmentation fault (core dumped)

$ Program received signal SIGSEGV, Segmentation fault.
__strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:76
76  VPCMPEQ (%rdi), %ymm0, %ymm1
(gdb) bt
#0  __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:76
#1  0x77edbd18 in debuginfod_query_server (c=c@entry=0x6930a0,
build_id=build_id@entry=0x0, build_id_len=build_id_len@entry=0,
type=type@entry=0x77ede3f8 "source", filename=filename@entry=0x688780
"/home/abuild/rpmbuild/BUILD/glibc-2.36/csu/../sysdeps/x86_64/crti.S",
path=path@entry=0x0) at
/usr/src/debug/elfutils-debuginfod-0.187-6.1.x86_64/debuginfod/debuginfod-client.c:644
#2  0x77edd212 in debuginfod_find_source (client=client@entry=0x6930a0,
build_id=build_id@entry=0x0, build_id_len=build_id_len@entry=0,
filename=filename@entry=0x688780
"/home/abuild/rpmbuild/BUILD/glibc-2.36/csu/../sysdeps/x86_64/crti.S",
path=path@entry=0x0) at
/usr/src/debug/elfutils-debuginfod-0.187-6.1.x86_64/debuginfod/debuginfod-client.c:1582
#3  0x0040b475 in slurp_file (abfd=0x6930a0, fst_return=0x7fffd070,
size_return=0x689730, fn=0x688780
"/home/abuild/rpmbuild/BUILD/glibc-2.36/csu/../sysdeps/x86_64/crti.S") at
../../binutils/objdump.c:1890
#4  try_print_file_open (origname=origname@entry=0x688780
"/home/abuild/rpmbuild/BUILD/glibc-2.36/csu/../sysdeps/x86_64/crti.S",
modname=modname@entry=0x688780
"/home/abuild/rpmbuild/BUILD/glibc-2.36/csu/../sysdeps/x86_64/crti.S",
fst_return=fst_return@entry=0x7fffd070, abfd=abfd@entry=0x666180) at
../../binutils/objdump.c:1998
#5  0x0040da71 in update_source_path (abfd=0x666180,
filename=) at ../../binutils/objdump.c:2028
#6  show_line (addr_offset=0, section=0x669118, abfd=0x666180) at
../../binutils/objdump.c:2273
#7  disassemble_bytes (relppend=0x0, relppp=, rel_offset=0,
stop_offset=27, start_offset=, data=0x67ccd0
"\363\017\036\372H\203\354\bH\213\005\341/", insns=,
disassemble_fn=0x44b6f0 , inf=) at
../../binutils/objdump.c:3315
#8  disassemble_section (abfd=0x666180, section=, inf=) at ../../binutils/objdump.c:4008
#9  0x0047316f in bfd_map_over_sections (abfd=abfd@entry=0x666180,
operation=operation@entry=0x40ba70 ,
user_storage=user_storage@entry=0x7fffd230) at ../../bfd/section.c:1373
#10 0x004087c5 in disassemble_data (abfd=abfd@entry=0x666180) at
../../binutils/objdump.c:4152
#11 0x004097dd in dump_bfd (abfd=abfd@entry=0x666180,
is_mainfile=is_mainfile@entry=true) at ../../binutils/objdump.c:5564
#12 0x0040a7ed in display_object_bfd (abfd=0x666180) at
../../binutils/objdump.c:5627
#13 display_any_bfd (file=0x666180, level=0) at ../../binutils/objdump.c:5713
#14 0x0040a944 in display_file (filename=0x7fffdbba
"/home/marxin/Programming/testcases/a.out", target=,
last_file=) at ../../binutils/objdump.c:5734
#15 0x0040533d in main (argc=, argv=) at
../../binutils/objdump.c:6130
(gdb) p build_id
$1 = (const unsigned char *) 0x0

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


[Bug binutils/29075] objdump -S does not support debuginfod

2022-10-25 Thread mliska at suse dot cz
https://sourceware.org/bugzilla/show_bug.cgi?id=29075

Martin Liska  changed:

   What|Removed |Added

   See Also||https://sourceware.org/bugz
   ||illa/show_bug.cgi?id=29720

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


[Bug binutils/29720] objdump -S crashes if build-id is missing

2022-10-25 Thread mliska at suse dot cz
https://sourceware.org/bugzilla/show_bug.cgi?id=29720

Martin Liska  changed:

   What|Removed |Added

   See Also||https://sourceware.org/bugz
   ||illa/show_bug.cgi?id=29075

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


[Bug ld/29722] New: ld.bfd accepts broken arguments

2022-10-25 Thread mliska at suse dot cz
https://sourceware.org/bugzilla/show_bug.cgi?id=29722

Bug ID: 29722
   Summary: ld.bfd accepts broken arguments
   Product: binutils
   Version: 2.40 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: ld
  Assignee: unassigned at sourceware dot org
  Reporter: mliska at suse dot cz
CC: nickc at sourceware dot org
  Target Milestone: ---

For instance, the following is accepted:

$ gcc-12 a.c -Wl,--hash-st=gnu
$ gcc-12 a.c -Wl,--hash-st=gnu -fuse-ld=gold
/usr/bin/ld.gold: --hash-st=gnu: unknown option
/usr/bin/ld.gold: use the --help option for usage information
collect2: error: ld returned 1 exit status
$ gcc-12 a.c -Wl,--hash-st=gnu -fuse-ld=lld
ld.lld: error: unknown argument '--hash-st=gnu'
collect2: error: ld returned 1 exit status

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


[Bug ld/29722] ld.bfd accepts broken arguments

2022-10-25 Thread sch...@linux-m68k.org
https://sourceware.org/bugzilla/show_bug.cgi?id=29722

--- Comment #1 from Andreas Schwab  ---
In which way is --hash-st=gnu broken?

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


[Bug ld/29722] ld.bfd accepts broken arguments

2022-10-25 Thread mliska at suse dot cz
https://sourceware.org/bugzilla/show_bug.cgi?id=29722

--- Comment #2 from Martin Liska  ---
(In reply to Andreas Schwab from comment #1)
> In which way is --hash-st=gnu broken?

It's not a listed option, it's only a prefix of an existing one. That's weird
and other programs also reject prefixes of valid options.

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


[Bug ld/29722] ld.bfd accepts broken arguments

2022-10-25 Thread sch...@linux-m68k.org
https://sourceware.org/bugzilla/show_bug.cgi?id=29722

Andreas Schwab  changed:

   What|Removed |Added

 Resolution|--- |NOTABUG
 Status|NEW |RESOLVED

--- Comment #3 from Andreas Schwab  ---
It's an unambigous abbreviation, thus it is accepted like any other getopt_long
user does.

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


[Bug ld/29722] ld.bfd accepts broken arguments

2022-10-25 Thread mliska at suse dot cz
https://sourceware.org/bugzilla/show_bug.cgi?id=29722

--- Comment #4 from Martin Liska  ---
Ok, but it makes such a command-line not portable among other linkers.

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


[Bug binutils/29720] objdump -S crashes if build-id is missing

2022-10-25 Thread amerey at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=29720

--- Comment #1 from Aaron Merey  ---
Created attachment 14414
  --> https://sourceware.org/bugzilla/attachment.cgi?id=14414&action=edit
patch

Thanks for catching this Martin. I've attached a patch that fixes this.

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


[Bug binutils/29720] objdump -S crashes if build-id is missing

2022-10-25 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=29720

--- Comment #2 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=6175be41757e886ce8ef5e792834aced3f5ae397

commit 6175be41757e886ce8ef5e792834aced3f5ae397
Author: Alan Modra 
Date:   Wed Oct 26 09:41:55 2022 +1030

PR29720, objdump -S crashes if build-id is missing

PR 29720
* objdump.c (slurp_file): Don't call debuginfod_find_source
when build_id is NULL.

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


[Bug binutils/29720] objdump -S crashes if build-id is missing

2022-10-25 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=29720

Alan Modra  changed:

   What|Removed |Added

   Assignee|unassigned at sourceware dot org   |amodra at gmail dot com
 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #3 from Alan Modra  ---
Fixed.  Aaron, thanks for the patch but I'd already written one myself.  Mine
is a teeny bit nicer in catching a memory leak of build_id when there is no
debuginfod, so that's the one I've committed.

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


[Bug binutils/29720] objdump -S crashes if build-id is missing

2022-10-25 Thread mliska at suse dot cz
https://sourceware.org/bugzilla/show_bug.cgi?id=29720

--- Comment #4 from Martin Liska  ---
Thank you guys, again, a nice example of cooperation ;)

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