[Bug binutils/27310] ar changed behavior in 2.36

2021-02-02 Thread mliska at suse dot cz
https://sourceware.org/bugzilla/show_bug.cgi?id=27310

Martin Liska  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID
 CC||doko at debian dot org

--- Comment #2 from Martin Liska  ---
You're right, the option is used wrongly in eppic package.

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


[Bug binutils/27309] readelf --debug-dump=info --wide output changes in 2.36

2021-02-02 Thread mliska at suse dot cz
https://sourceware.org/bugzilla/show_bug.cgi?id=27309

--- Comment #3 from Martin Liska  ---
(In reply to Nick Clifton from comment #2)
> Hi Martin,
> 
>   The change was made so that the output from the binutils readelf would be
> closer to that of the elfutils readelf.  Vis:
> 
> Old Binutils:
> <14>   DW_AT_name   : (indirect string, offset: 0x69):
> ../sysdeps/x86_64/crti.S
> 
> 2.36 Binutils:
><14>   DW_AT_name: (strp) (offset: 0x69): ../sysdeps/x86_64/crti.S
>  
> Elfutils:
>   name(strp) "../sysdeps/x86_64/crti.S"

I've got this point, makes sense. But I don't get why is that related to --wide
option?
To be honest, the output of non-wide mode is longer and more verbose than
--wide option
output:

$ readelf --debug-dump=info --wide /tmp/sample_struct.o | head -n20 | grep
offset
<11>   DW_AT_name: (strp) (offset: 0x12d):
mpers-m32/sample_struct.c
<15>   DW_AT_comp_dir: (strp) (offset: 0x89):
/home/abuild/rpmbuild/BUILD/strace-5.10
<20>   DW_AT_name: (strp) (offset: 0x56): unsigned char

$ readelf --debug-dump=info /tmp/sample_struct.o | head -n20 | grep offset
<11>   DW_AT_name: (indirect string, offset: 0x12d):
mpers-m32/sample_struct.c
<15>   DW_AT_comp_dir: (indirect string, offset: 0x89):
/home/abuild/rpmbuild/BUILD/strace-5.10
<20>   DW_AT_name: (indirect string, offset: 0x56): unsigned char

...

>   Can the strace configure script be adapted to cope with both versions 
>   of readelf's output ?

I can report that to them. It's unpleasant that parsing would depend
on the version of binutils.

Thanks,
Martin

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


[Bug binutils/27314] New: objcopy overwrite sections

2021-02-02 Thread p...@void-ptr.info
https://sourceware.org/bugzilla/show_bug.cgi?id=27314

Bug ID: 27314
   Summary: objcopy overwrite sections
   Product: binutils
   Version: 2.36
Status: UNCONFIRMED
  Severity: critical
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: p...@void-ptr.info
  Target Milestone: ---

Created attachment 13193
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13193&action=edit
object file (ELF)

objcopy overwrite sections. Affected at least 2.36, 2.35.

Sample:

objcopy -O binary typesize.o typesize.bin

objdump -s typesize.o

typesize.o: file format elf64-x86-64

Contents of section .rodata:
  7ac8db4e 97b49c19 5f5f7533 32000400  z..N__u32...
 0010 6361705f 75736572 5f646174 615f7400  cap_user_data_t.
 0020 08006361 705f7573 65725f68 65616465  ..cap_user_heade
 0030 725f7400 08006368 6172202a 00080063  r_t...char *...c
...
Contents of section .note.gnu.property:
  0400 2000 0500 474e5500   ...GNU.
 0010 020001c0 0400    
 0020 010001c0 0400 0100   

The section .note.gnu.property overwrite section .rodata:

hexdump -C typesize.bin
  04 00 00 00 20 00 00 00  05 00 00 00 47 4e 55 00  | ...GNU.|
0010  02 00 01 c0 04 00 00 00  00 00 00 00 00 00 00 00  ||
0020  01 00 01 c0 04 00 00 00  01 00 00 00 00 00 00 00  ||
0030  72 5f 74 00 08 00 63 68  61 72 20 2a 00 08 00 63  |r_t...char *...c|
0040  68 61 72 20 2a 20 63 6f  6e 73 74 20 2a 00 08 00  |har * const *...|
0050  63 6f 6e 73 74 20 63 68  61 72 20 2a 00 08 00 63  |const char *...c|
...

If section .note.gnu.property removed, the result (at least for .rodata) is
fine.

objcopy -O binary --remove-section .note.gnu.property typesize.o typesize.bin
hexdump -C typesize.bin
  7a c8 db 4e 97 b4 9c 19  5f 5f 75 33 32 00 04 00  |z..N__u32...|
0010  63 61 70 5f 75 73 65 72  5f 64 61 74 61 5f 74 00  |cap_user_data_t.|
0020  08 00 63 61 70 5f 75 73  65 72 5f 68 65 61 64 65  |..cap_user_heade|
0030  72 5f 74 00 08 00 63 68  61 72 20 2a 00 08 00 63  |r_t...char *...c|
0040  68 61 72 20 2a 20 63 6f  6e 73 74 20 2a 00 08 00  |har * const *...|


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


[Bug ld/27311] ld.bfd (symbol from plugin): undefined reference to symbol since b1a92c635c1ec10fd703302ce1fc4ab3a8515a04

2021-02-02 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=27311

--- Comment #8 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=9918bff7cf2a566aaa2036d2242a61c140652dc7

commit 9918bff7cf2a566aaa2036d2242a61c140652dc7
Author: Alan Modra 
Date:   Tue Feb 2 15:05:14 2021 +1030

PR27311, ld.bfd (symbol from plugin): undefined reference

A default versioned symbol definition in a shared library is
overridden by an unversioned definition in a regular object file, and
thus should not be reason to make an as-needed library needed.

bfd/
PR 27311
* elflink.c (_bfd_elf_add_default_symbol): Add override parameter.
Use when handling default versioned symbol.  Rename existing
override variable to nondef_override and use for non-default
versioned symbol.
(elf_link_add_object_symbols): Adjust call to suit.  Don't
pull in as-needed libraries when override is set.
ld/
* testsuite/ld-plugin/pr27311.d,
* testsuite/ld-plugin/pr27311.ver,
* testsuite/ld-plugin/pr27311a.c,
* testsuite/ld-plugin/pr27311b.c,
* testsuite/ld-plugin/pr27311c.c: New testcase.
* testsuite/ld-plugin/lto.exp: Run it.  Correct PR14918 and
PR12982 entries.

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


[Bug ld/27311] ld.bfd (symbol from plugin): undefined reference to symbol since b1a92c635c1ec10fd703302ce1fc4ab3a8515a04

2021-02-02 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=27311

--- Comment #9 from Alan Modra  ---
Ignore the gcc-7 and gcc-8 comment.  I wasn't picking up the ld I thought I
was.  I'll apply the patch to the 2.36 branch too after some more testing.

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


[Bug binutils/27281] readelf: SHF_GNU_RETAIN ('R') is not listed in `Key to Flags:`

2021-02-02 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=27281

--- Comment #1 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=5424d7ed94cf5a7ca24636ab9f4e6d5c353fc0d3

commit 5424d7ed94cf5a7ca24636ab9f4e6d5c353fc0d3
Author: H.J. Lu 
Date:   Tue Feb 2 05:14:48 2021 -0800

readelf: Add 'R' and 'D' to "Key to Flags:"

Add "R (retain)" and "D (mbind)" to "Key to Flags:".

PR binutils/27281
* readelf.c (process_section_headers): Add 'R' and 'D' to
"Key to Flags:".
* testsuite/binutils-all/retain1a.d: Updated.

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


[Bug libctf/27297] libctf.a malformed, build fails on x86_64-apple-darwin18.7.0

2021-02-02 Thread nick.alcock at oracle dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=27297

Nick Alcock  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||nick.alcock at oracle dot com
   Assignee|unassigned at sourceware dot org   |nick.alcock at oracle 
dot com

--- Comment #3 from Nick Alcock  ---
Replicated. Working on a fix.

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


[Bug binutils/27281] readelf: SHF_GNU_RETAIN ('R') is not listed in `Key to Flags:`

2021-02-02 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=27281

H.J. Lu  changed:

   What|Removed |Added

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

--- Comment #2 from H.J. Lu  ---
Fixed for 2.37.

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


[Bug binutils/27314] objcopy overwrite sections

2021-02-02 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=27314

H.J. Lu  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |NOTABUG

--- Comment #1 from H.J. Lu  ---
I don't think you can use "objcopy -O binary" on relocatable object
since all sections are copied to offset 0:

[hjl@gnu-cfl-2 pr27314]$ cat foo.s
.text
.section.rodata
.string "This is a test"
.text
.globl  foo
.type   foo, @function
foo:
pushq   %rbp
movq%rsp, %rbp
nop
popq%rbp
ret
.size   foo, .-foo
[hjl@gnu-cfl-2 pr27314]$ make
as -mx86-used-note=no  -o foo.o foo.s
./objcopy -O binary foo.o foo.bin
hexdump -C foo.bin
  54 68 69 73 20 69 73 20  61 20 74 65 73 74 00 |This is a test.|
000f
[hjl@gnu-cfl-2 pr27314]$

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


[Bug gold/27303] gold/testsuite/initpri3. test fails on gold and lld, passes on bfd. Which one is correct?

2021-02-02 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=27303

--- Comment #1 from H.J. Lu  ---
I couldn't reproduce it on Fedora 33.

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


[Bug binutils/27314] objcopy overwrite sections

2021-02-02 Thread p...@void-ptr.info
https://sourceware.org/bugzilla/show_bug.cgi?id=27314

Petr Ovtchenkov  changed:

   What|Removed |Added

 Resolution|NOTABUG |---
 Status|RESOLVED|UNCONFIRMED

--- Comment #2 from Petr Ovtchenkov  ---
You can discuss this with klibc guys
(git://git.kernel.org/pub/scm/libs/klibc/klibc.git) and Hans Peter Anven:

commit de6f630e6be90d6d32d8bf2fed3f856b0c32f7ba
Author: H. Peter Anvin 
Date:   Sat Jun 10 11:15:19 2006 -0700

[klibc] Detect the sizes of various types, and make available to
sysstub.ph.

This additional code effectively queries the C compiler for the sizes of
various types, and makes an associative array %typesize available to
sysstub.ph.  This is currently not used, but it's expected that some
architectures, e.g. s390, will need this to determine which registers
go where, and how many registers are needed.

Signed-off-by: H. Peter Anvin 

In any case, behavior of objcopy looks strange: it overlap section without any
note.

You test give nothing: as you see, in case of absent .note.gnu.property section
problem disappear (no overlapping section, no problems).

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


[Bug ld/27311] ld.bfd (symbol from plugin): undefined reference to symbol since b1a92c635c1ec10fd703302ce1fc4ab3a8515a04

2021-02-02 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=27311

--- Comment #10 from Alan Modra  ---
Further testing found a regression of the pr16467 testcase when using a
compiler defaulting to --as-needed.  The patch needs more work.

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


[Bug binutils/27314] objcopy overwrite sections

2021-02-02 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=27314

Alan Modra  changed:

   What|Removed |Added

   Severity|critical|normal
 Resolution|--- |NOTABUG
 Status|UNCONFIRMED |RESOLVED

--- Comment #3 from Alan Modra  ---
This really is not an objcopy bug.  If you hit your finger with a hammer that's
not a problem with the hammer but with the way you're using the hammer.

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


[Bug ld/27311] ld.bfd (symbol from plugin): undefined reference to symbol since b1a92c635c1ec10fd703302ce1fc4ab3a8515a04

2021-02-02 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=27311

--- Comment #11 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=6955136728a68365bbb5e6e1327dff1654b2a0ca

commit 6955136728a68365bbb5e6e1327dff1654b2a0ca
Author: Alan Modra 
Date:   Wed Feb 3 10:57:12 2021 +1030

PR27311 again, ld.bfd (symbol from plugin): undefined reference

bfd/
PR 27311
* elflink.c (_bfd_elf_add_default_symbol): Clear override when
undecorated symbol will have a different version.
ld/
* testsuite/ld-ifunc/ifunc.exp (libpr16467b.so, libpr16467bn.so):
Link with --as-needed.

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


[Bug binutils/27284] ar: wrong permissions on output file

2021-02-02 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=27284

--- 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=95b91a043aeaeb546d2fea556d84a2de1e917770

commit 95b91a043aeaeb546d2fea556d84a2de1e917770
Author: Alan Modra 
Date:   Mon Feb 1 02:04:41 2021 +1030

pr27270 and pr27284, ar segfaults and wrong file mode

PR 27270
PR 27284
PR 26945
* ar.c: Don't include libbfd.h.
(write_archive): Replace xmalloc+strcpy with xstrdup.  Use
bfd_stat rather than fstat on iostream.  Move stat and fd tests
outside of _WIN32 ifdef.  Delete skip_stat variable.
* arsup.c (temp_name, real_ofd): New static variables.
(ar_open): Use make_tempname and bfd_fdopenw.
(ar_save): Adjust to suit ar_open changes.  Move stat output
of _WIN32 ifdef.
* objcopy.c: Don't include libbfd.h.
(copy_file): Use bfd_stat.

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


[Bug binutils/27270] ar segfaults trying to build virtualbox guest additions

2021-02-02 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=27270

--- Comment #3 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=95b91a043aeaeb546d2fea556d84a2de1e917770

commit 95b91a043aeaeb546d2fea556d84a2de1e917770
Author: Alan Modra 
Date:   Mon Feb 1 02:04:41 2021 +1030

pr27270 and pr27284, ar segfaults and wrong file mode

PR 27270
PR 27284
PR 26945
* ar.c: Don't include libbfd.h.
(write_archive): Replace xmalloc+strcpy with xstrdup.  Use
bfd_stat rather than fstat on iostream.  Move stat and fd tests
outside of _WIN32 ifdef.  Delete skip_stat variable.
* arsup.c (temp_name, real_ofd): New static variables.
(ar_open): Use make_tempname and bfd_fdopenw.
(ar_save): Adjust to suit ar_open changes.  Move stat output
of _WIN32 ifdef.
* objcopy.c: Don't include libbfd.h.
(copy_file): Use bfd_stat.

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


[Bug binutils/26945] Unsafe chown+chmod in smart_rename, possibly elsewhere

2021-02-02 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=26945

--- Comment #18 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=95b91a043aeaeb546d2fea556d84a2de1e917770

commit 95b91a043aeaeb546d2fea556d84a2de1e917770
Author: Alan Modra 
Date:   Mon Feb 1 02:04:41 2021 +1030

pr27270 and pr27284, ar segfaults and wrong file mode

PR 27270
PR 27284
PR 26945
* ar.c: Don't include libbfd.h.
(write_archive): Replace xmalloc+strcpy with xstrdup.  Use
bfd_stat rather than fstat on iostream.  Move stat and fd tests
outside of _WIN32 ifdef.  Delete skip_stat variable.
* arsup.c (temp_name, real_ofd): New static variables.
(ar_open): Use make_tempname and bfd_fdopenw.
(ar_save): Adjust to suit ar_open changes.  Move stat output
of _WIN32 ifdef.
* objcopy.c: Don't include libbfd.h.
(copy_file): Use bfd_stat.

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