[Bug binutils/25873] New: ar segfaults when liblto_plugin.so.0.0.0 is a symlink in /usr/lib/bfd-plugins

2020-04-24 Thread tstellar at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25873

Bug ID: 25873
   Summary: ar segfaults when liblto_plugin.so.0.0.0 is a symlink
in /usr/lib/bfd-plugins
   Product: binutils
   Version: 2.34
Status: NEW
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: tstellar at redhat dot com
  Target Milestone: ---

ar segfaults when using a plugin from /usr/lib/bfd-plugins that is a symlink. 
Here is how to reproduce:

echo "int foo(){}" | gcc -flto -O2 -c -x c -o foo.o -
echo "int bar(){}" | gcc -flto -O2 -c -x c -o bar.o -
ln -s /usr/libexec/gcc/x86_64-redhat-linux/10/liblto_plugin.so.0.0.0
/usr/lib/bfd-plugins/
ar crs foo.a foo.o bar.o
Segmentation fault (core dumped)


If the plugin is copied directly and not a symlink, then there is no segfault:


rm /usr/lib/bfd-plugins/liblto_plugin.so.0.0.0 
cp /usr/libexec/gcc/x86_64-redhat-linux/10/liblto_plugin.so.0.0.0
/usr/lib/bfd-plugins/
ar crs foo.a foo.o bar.o

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


[Bug binutils/25873] ar segfaults when liblto_plugin.so.0.0.0 is a symlink in /usr/lib/bfd-plugins

2020-04-24 Thread tstellar at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25873

--- Comment #1 from Tom Stellard  ---
It also seems like the LLVMgold.so plugin does not have the same problem.  This
similar sequence works with this plugin:

echo "int foo(){}" | clang -flto -O2 -c -x c -o foo.o -
echo "int bar(){}" | clang -flto -O2 -c -x c -o bar.o -
ln -s /usr/lib64/LLVMgold.so /usr/lib/bfd-plugins/
ar crs foo.a foo.o bar.o

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


[Bug binutils/25873] ar segfaults when liblto_plugin.so.0.0.0 is a symlink in /usr/lib/bfd-plugins

2020-04-27 Thread tstellar at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25873

--- Comment #4 from Tom Stellard  ---
(In reply to Nick Clifton from comment #3)
> Hi Tom,
> 
>   I am sorry but I cannot reproduce this.  It seems very strange that a
>   symlink should be causing a segmentation fault when a copy does not.
> 

I am able to reproduce this running in the fedora:rawhide container image, so
you may want to give that a try.

>   The "ar" program that you are running - is this the binutils ar binary
>   or is it an alias/symlink for the gcc-ar script ?
> 

ar is not a symlink or alias as far as I can tell.

>   If you have the symlink in place and you run:
> 
> ar crs --plugin /usr/lib/bfd-plugins/liblto_plugin.so.0.0.0 foo.a foo.o
> bar.o
> 
>   Does that work ?
> 

Yes, this works.

>   Does the problem persist if you use the current mainline development
>   sources for the binutils rather than the 2.34 release ?
> 

I will try the development sources.  I'm currently testing with
gcc-10.0.1-0.12.fc33 and binutils-2.34-3.fc33.

> Cheers
>   Nick

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


[Bug binutils/25873] ar segfaults when liblto_plugin.so.0.0.0 is a symlink in /usr/lib/bfd-plugins

2020-04-27 Thread tstellar at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25873

--- Comment #6 from Tom Stellard  ---
(In reply to Andreas Schwab from comment #5)
> This might be a fedora specific bug, so try filing a bug there first.

It looks like this is caused by a Fedora specific patch, so I've filed a bug in
the Fedora bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1828587

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


[Bug binutils/26112] New: readelf --debug-dump=macro can't parse clang debug info

2020-06-11 Thread tstellar at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26112

Bug ID: 26112
   Summary: readelf --debug-dump=macro can't parse clang debug
info
   Product: binutils
   Version: 2.34
Status: NEW
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: tstellar at redhat dot com
  Target Milestone: ---

Created attachment 12621
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12621&action=edit
Clang binary output.

Test case:

$ echo "#define FOO bar" | clang -x c -c - -fdebug-macro -gdwarf-5 -o
clang-debug-macro.o
$ readelf --debug-dump=macro ./clang-debug-macro.o 
Contents of the .debug_macro section:

  Offset:  0x0
  Version: 5
  Offset size: 4
  Offset into .debug_line: 0x0

 DW_MACRO_start_file - lineno: 0 filenum: 1
readelf: ./clang-debug-macro.o: Error:  Unknown macro opcode 0b seen



I'm using binutils-2.34.0-6.fc33 from Fedora and clang 11 (which is current
trunk).  It looks this used to work, but stopped working after clang commit:
https://github.com/llvm/llvm-project/commit/b47403c0a4c532554cf3d67ed1669fe00530aab3

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