[Bug binutils/25080] [2.33 Regression] strip removes relro program header

2019-10-16 Thread doko at debian dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=25080

--- Comment #3 from Matthias Klose  ---
now at
https://people.debian.org/~guillem/strip-relro/liblog4cplus-2.0.so.3.4.4.xz

-- 
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/25110] FAIL: --gc-sections with __start_SECTIONNAME

2019-10-16 Thread dave.anglin at bell dot net
https://sourceware.org/bugzilla/show_bug.cgi?id=25110

--- Comment #2 from dave.anglin at bell dot net ---
On 2019-10-15 10:23 p.m., amodra at gmail dot com wrote:
> Works for me with hppa-linux-gcc (GCC) 8.1.1 20180502
It's probably because I recently changed the optimization of indirect calls in
gcc-9 and gcc-10.  Gcc
no longer converts indirect calls to an inline version of $$dyncall if
$$dyncall can be reached with a
pc-relative or "ble" branch.  Only the long PIC branch to $$dyncall is now
optimized into inline
versions of $$dyncall.

The reason is $$dyncall is slightly shorter and the inline sequences got
slightly longer in order to
load the branch target before the new PIC register value.

The above changes are preliminary to fixing a glibc race in lazy binding.

Final executables always need to be linked against the millicode library on
hppa to provide $$dyncall
and various arithmetic operations that are implemented in assembly.  Seems we
have lost that in test.

-- 
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/13616] linker should pad executable sections with nops, not zeros

2019-10-16 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=13616

--- Comment #7 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=22216541c1796e9e1331d6f4e16b03a6f02e7381

commit 22216541c1796e9e1331d6f4e16b03a6f02e7381
Author: Alan Modra 
Date:   Wed Oct 16 21:23:29 2019 +1030

PR13616, linker should pad executable sections with nops, not zeros

This implements padding of orphan executable sections for PowerPC.
Of course, the simple implementation of bfd_arch_ppc_nop_fill and
removing the NOP definition didn't work, with powerpc64 hitting a
testsuite failure linking to S-records.  That's because the srec
target is BFD_ENDIAN_UNKNOWN so the test of bfd_big_endian (abfd) in
default_data_link_order therefore returned false, resulting in a
little-endian nop pattern.  The rest of the patch fixes that problem
by adding a new field to bfd_link_info that can be used to determine
actual endianness on targets like srec.

PR 13616
include/
* bfdlink.h (struct bfd_link_info ): New field.
bfd/
* cpu-powerpc.c (bfd_arch_ppc_nop_fill): New function, use it
for all ppc arch info.
* linker.c (default_data_link_order): Pass info->big_endian to
arch_info->fill function.
ld/
* emulparams/elf64lppc.sh (NOP): Don't define.
* emulparams/elf64ppc.sh (NOP): Don't define.
* ldwrite.c (build_link_order): Use link_info.big_endian.  Move
code determining endian to use for data_statement to..
* ldemul.c (after_open_default): ..here.  Set link_info.big_endian.

-- 
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/25080] strip removes relro program header

2019-10-16 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25080

Alan Modra  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |INVALID
Summary|[2.33 Regression] strip |strip removes relro program
   |removes relro program   |header
   |header  |

--- Comment #4 from Alan Modra  ---
So comment #2 is correct.  Removing the PT_GNU_RELRO on changing allocatable
sections has been done ever since binutils-2.19.  I suppose you could claim
this is a regression against binutils-2.18 but the behaviour change is
deliberate.

Don't create a library with an alloc .comment section.  That's just silly.

-- 
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/25110] FAIL: --gc-sections with __start_SECTIONNAME

2019-10-16 Thread dave.anglin at bell dot net
https://sourceware.org/bugzilla/show_bug.cgi?id=25110

--- Comment #3 from dave.anglin at bell dot net ---
On 2019-10-16 7:33 a.m., John David Anglin wrote:
> Final executables always need to be linked against the millicode library on 
> hppa to provide $$dyncall
> and various arithmetic operations that are implemented in assembly.  Seems we 
> have lost that in test.

There is this code in ld/testsuite/ld-selective/selective.exp:

    # HPPA linux targets need libgcc.a for millicode routines ($$dyncall).
    if [istarget hppa*-*-linux*] {
    set libgcc [remote_exec host "$compiler -print-libgcc-file-name"]
    set libgcc [lindex $libgcc 1]
    regsub -all "\[\r\n\]" $libgcc "" libgcc
    set objfile "$objfile $libgcc"
    }

-- 
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/23567] much larger static binaries compared to a few months ago

2019-10-16 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=23567

--- Comment #10 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Keith Seitz :

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

commit 950b74950f6020eda38647f22e9077ac7f68ca49
Author: Keith Seitz 
Date:   Wed Oct 16 11:33:59 2019 -0700

DWARF reader: Reject sections with invalid sizes

This is another fuzzer bug, gdb/23567.  This time, the fuzzer has
specifically altered the size of .debug_str:

$ eu-readelf -S objdump
Section Headers:
[Nr] Name Type Addr Off  Size
ES Flags Lk Inf Al
[31] .debug_str   PROGBITS  0057116d
  1 MS 0   0  1

When this file is loaded into GDB, the DWARF reader crashes attempting
to access the string table (or it may just store a bunch of nonsense):

[gdb-8.3-6-fc30]
$ gdb -nx -q objdump
BFD: warning: /path/to/objdump has a corrupt section with a size
() larger than the file size
Reading symbols from /path/to/objdump...
Segmentation fault (core dumped)

Nick has already committed a BFD patch to issue the warning seen above.

[gdb master 6acc1a0b]
$ gdb -BFD: warning: /path/to/objdump has a corrupt section with a size
() larger than the file size
Reading symbols from /path/to/objdump...
(gdb) inf func
All defined functions:

File ./../include/dwarf2.def:
186:const

  8 *>(.:
 ;'@�B);
747:const

  8 *�(.:
 ;'@�B);
701:const

  8 *�D �
 (.:
;'@�B);
71: const

  8 *(.:
;'@�B);
/* and more gibberish  */

Consider read_indirect_string_at_offset_from:

static const char *
read_indirect_string_at_offset_from (struct objfile *objfile,
 bfd *abfd, LONGEST str_offset,
 struct dwarf2_section_info *sect,
 const char *form_name,
 const char *sect_name)
{
  dwarf2_read_section (objfile, sect);
  if (sect->buffer == NULL)
error (_("%s used without %s section [in module %s]"),
   form_name, sect_name, bfd_get_filename (abfd));
  if (str_offset >= sect->size)
error (_("%s pointing outside of %s section [in module %s]"),
   form_name, sect_name, bfd_get_filename (abfd));
  gdb_assert (HOST_CHAR_BIT == 8);
  if (sect->buffer[str_offset] == '\0')
return NULL;
  return (const char *) (sect->buffer + str_offset);
}

With sect_size being ginormous, the code attempts to access
sect->buffer[GINORMOUS], and depending on the layout of memory,
GDB either stores a bunch of gibberish strings or crashes.

This is an attempt to mitigate this by implementing a similar approach
used by BFD. In our case, we simply reject the section with the invalid
length:

$ ./gdb -nx -q objdump
BFD: warning: /path/to/objdump has a corrupt section with a size
() larger than the file size
Reading symbols from /path/to/objdump...

warning: Discarding section .debug_str which has a section size
() larger than the file size [in module /path/to/objdump]
DW_FORM_strp used without .debug_str section [in module /path/to/objdump]
(No debugging symbols found in /path/to/objdump)
(gdb)

Unfortunately, I have not found a way to regression test this, since it
requires poking ELF section headers.

gdb/ChangeLog:
2019-10-16  Keith Seitz  

PR gdb/23567
* dwarf2read.c (dwarf2_per_objfile::locate_sections): Discard
sections whose size is greater than the file size.

Change-Id: I896ac3b4eb2207c54e8e05c16beab3051d9b4b2f

-- 
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/25110] FAIL: --gc-sections with __start_SECTIONNAME

2019-10-16 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25110

--- Comment #4 from Alan Modra  ---
Created attachment 12042
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12042&action=edit
possible fix

This patch should allow the test to pass.

-- 
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/25110] FAIL: --gc-sections with __start_SECTIONNAME

2019-10-16 Thread danglin at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=25110

--- Comment #5 from John David Anglin  ---
Created attachment 12043
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12043&action=edit
Patch

This is a horrible hack to avoid $$dyncall being called when using gcc-9 and
gcc-10, but I wasn't able to figure out a way to cause the test to link against
libgcc.

-- 
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/25110] FAIL: --gc-sections with __start_SECTIONNAME

2019-10-16 Thread danglin at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=25110

--- Comment #6 from John David Anglin  ---
The "possible fix" works for me.

-- 
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/25110] FAIL: --gc-sections with __start_SECTIONNAME

2019-10-16 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25110

--- Comment #7 from Alan Modra  ---
OK, I'm leaving it up to you to apply whichever of these patches you prefer.. 
Yours has this to recommend it in being similar to other target hacks in
gc.exp.

-- 
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 gas/29] Coreutils POSIX2_VERSION as 200112L

2019-10-16 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=29

Alan Modra  changed:

   What|Removed |Added

 Status|SUSPENDED   |ASSIGNED
   Assignee|bje at sources dot redhat.com  |amodra at gmail dot com
   Target Milestone|--- |2.34

-- 
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 gas/29] Coreutils POSIX2_VERSION as 200112L

2019-10-16 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=29

--- Comment #15 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=a315e14713de0a712382b3159507c16a0975a8d1

commit a315e14713de0a712382b3159507c16a0975a8d1
Author: Alan Modra 
Date:   Thu Oct 17 16:25:38 2019 +1030

PR29, Coreutils POSIX2_VERSION as 200112L

As of today we have just the following oddities left
./gnulib/update-gnulib.sh:ver=`autoconf --version 2>&1 | head -1 | sed
's/.*) //'`
./gnulib/update-gnulib.sh:ver=`automake --version 2>&1 | head -1 | sed
's/.*) //'`
./gnulib/update-gnulib.sh:ver=`aclocal --version 2>&1 | grep -v "called too
early to check prototype" | head -1 | sed 's/.*) //'`
./src-release.sh:   head -1 $tool/version.in
./contrib/dg-extract-results.sh:tail -2 $FIRST_SUM | $GREP '^#' > /dev/null
|| tail -2 $FIRST_SUM

gnulib and contrib (from gcc) are outside of binutils control, so with
this patch I'm going to declare this 15 year old bug fixed.

PR 29
* src-release.sh (getver): Replace "head -1" with "head -n 1".

-- 
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 gas/29] Coreutils POSIX2_VERSION as 200112L

2019-10-16 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=29

Alan Modra  changed:

   What|Removed |Added

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

--- Comment #14 from Alan Modra  ---
Fixed.

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