[Bug ld/26918] s390x: ld segfaults when htab->elf.sgot is NULL

2020-11-23 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26918

H.J. Lu  changed:

   What|Removed |Added

 Resolution|--- |FIXED
   Target Milestone|--- |2.36
 Status|REOPENED|RESOLVED

--- Comment #9 from H.J. Lu  ---
Fixed for 2.36.

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


[Bug ld/26918] s390x: ld segfaults when htab->elf.sgot is NULL

2020-11-23 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=26918

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

commit cbf097d7b024fad33d13cc43ff0d35f2e0b11898
Author: H.J. Lu 
Date:   Mon Nov 23 05:06:51 2020 -0800

s390x: Set .got sh_entsize only if .got size > 0

bfd/

PR ld/26918
* elf64-s390.c (elf_s390_finish_dynamic_sections): Set .got
sh_entsize only if .got size > 0.

ld:

PR ld/26918
* testsuite/ld-s390/pr26918-1.d: New file.
* testsuite/ld-s390/pr26918-1.s: Likewise.
* testsuite/ld-s390/s390.exp: Run all *.d tests.

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


[Bug ld/26918] s390x: ld segfaults when htab->elf.sgot is NULL

2020-11-20 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26918

--- Comment #7 from H.J. Lu  ---
Created attachment 12987
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12987=edit
A patch

This patch allows me to build glibc.

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


[Bug ld/26918] s390x: ld segfaults when htab->elf.sgot is NULL

2020-11-20 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26918

H.J. Lu  changed:

   What|Removed |Added

 Resolution|FIXED   |---
 Status|RESOLVED|REOPENED

--- Comment #6 from H.J. Lu  ---
The fix caused glibc build failure:

Program received signal SIGSEGV, Segmentation fault.
0x00445955 in elf_s390_finish_dynamic_sections (output_bfd=0x5b45a0, 
info=0x597c20 )
at /export/gnu/import/git/sources/binutils-gdb/bfd/elf64-s390.c:3550
3550  if (elf_section_data (htab->elf.splt->output_section) != NULL)
Missing separate debuginfos, use: dnf debuginfo-install
zlib-1.2.11-22.0.fc33.x86_64
(gdb) bt
#0  0x00445955 in elf_s390_finish_dynamic_sections (
output_bfd=0x5b45a0, info=0x597c20 )
at /export/gnu/import/git/sources/binutils-gdb/bfd/elf64-s390.c:3550
#1  0x00473389 in bfd_elf_final_link (abfd=, 
info=)
at /export/gnu/import/git/sources/binutils-gdb/bfd/elflink.c:13173
#2  0x0041ccd4 in ldwrite ()
at /export/gnu/import/git/sources/binutils-gdb/ld/ldwrite.c:545
#3  0x00404979 in main (argc=, argv=)
at /export/gnu/import/git/sources/binutils-gdb/ld/ldmain.c:512
(gdb) p htab->elf.splt
$1 = (asection *) 0x0
(gdb)

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


[Bug ld/26918] s390x: ld segfaults when htab->elf.sgot is NULL

2020-11-19 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26918

Nick Clifton  changed:

   What|Removed |Added

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

--- Comment #5 from Nick Clifton  ---
Hi Ilya,

  OK, I have applied the patch.

Cheers
  Nick

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


[Bug ld/26918] s390x: ld segfaults when htab->elf.sgot is NULL

2020-11-19 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=26918

--- Comment #4 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Nick Clifton :

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

commit a4eba6087d4cec81f8b41477b4da56ff87b88e91
Author: Nick Clifton 
Date:   Thu Nov 19 17:36:24 2020 +

Fix a bug in the s390x linker when discarding all inpuit files.

PR 26918
* elf64-s390.c (elf_s390_finish_dynamic_sections): Check for the
existance of an sgot output section before setting the
sh_entsize.

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


[Bug ld/26918] s390x: ld segfaults when htab->elf.sgot is NULL

2020-11-19 Thread iii at linux dot ibm.com
https://sourceware.org/bugzilla/show_bug.cgi?id=26918

--- Comment #3 from Ilya Leoshkevich  ---
Created attachment 12977
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12977=edit
object file

I've attached the object file.

This is the minimized ld invocation that segfaults (tried with
binutils-2_35_1):

ld --script=test.lds test.o -L/lib64 -lc

I've also tried binutils-2_35_1 + your patch, and it did not crash.

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


[Bug ld/26918] s390x: ld segfaults when htab->elf.sgot is NULL

2020-11-19 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26918

--- Comment #2 from Nick Clifton  ---
Created attachment 12976
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12976=edit
Proposed patch

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


[Bug ld/26918] s390x: ld segfaults when htab->elf.sgot is NULL

2020-11-19 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26918

Nick Clifton  changed:

   What|Removed |Added

   Last reconfirmed||2020-11-19
   Assignee|unassigned at sourceware dot org   |nickc at redhat dot com
 Ever confirmed|0   |1
 CC||nickc at redhat dot com
 Status|UNCONFIRMED |ASSIGNED

--- Comment #1 from Nick Clifton  ---
Hi Ilya,

  Does this problem still happen with the 2.35 release ?

  If it does, please could you upload the object file from 
  the compilation (ie test.o), and also let us know the full 
  linker command line that is being invoked by gcc ?

  Additionally, how was the toolchain you are using configured ?

  Finally, please can you try out the uploaded patch.  If I
  am right then it will fix the problem, but at the moment
  this is just a guess.

Cheers
  Nick

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


[Bug ld/26918] s390x: ld segfaults when htab->elf.sgot is NULL

2020-11-18 Thread iii at linux dot ibm.com
https://sourceware.org/bugzilla/show_bug.cgi?id=26918

Ilya Leoshkevich  changed:

   What|Removed |Added

 CC||krebbel at linux dot ibm.com

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