[Bug ld/29802] Segmentation fault in _bfd_elf_strtab_add

2023-08-10 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=29802

Sam James  changed:

   What|Removed |Added

 CC||sam at gentoo dot org

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


[Bug ld/29802] Segmentation fault in _bfd_elf_strtab_add

2022-11-19 Thread danglin at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=29802

--- Comment #7 from John David Anglin  ---
Created attachment 14469
  --> https://sourceware.org/bugzilla/attachment.cgi?id=14469=edit
sincos_table.s

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


[Bug ld/29802] Segmentation fault in _bfd_elf_strtab_add

2022-11-19 Thread danglin at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=29802

--- Comment #6 from John David Anglin  ---
bash-5.1$ readelf -x 15 ./math/.libs/sincos_table.o

Hex dump of section '.strtab':
  0x 0073696e 636f735f 7461626c 652e6300 .sincos_table.c.
  0x0010 5f5f7369 6e636f73 715f7461 626c6500 __sincosq_table.

sincos_table.o was assembled with gas.

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


[Bug ld/29802] Segmentation fault in _bfd_elf_strtab_add

2022-11-19 Thread danglin at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=29802

--- Comment #5 from John David Anglin  ---
libtool: link: /home/dave/gnu/gcc/objdir64/./gcc/xgcc
-B/home/dave/gnu/gcc/objdi
r64/./gcc/ -B/opt/gnu64/gcc_gld/gcc-13/hppa64-hp-hpux11.11/bin/
-B/opt/gnu64/gcc
_gld/gcc-13/hppa64-hp-hpux11.11/lib/ -isystem
/opt/gnu64/gcc_gld/gcc-13/hppa64-h
p-hpux11.11/include -isystem
/opt/gnu64/gcc_gld/gcc-13/hppa64-hp-hpux11.11/sys-i
nclude-shared  math/.libs/x2y2m1q.o math/.libs/acoshq.o math/.libs/fmodq.o
m
ath/.libs/acosq.o math/.libs/frexpq.o math/.libs/rem_pio2q.o
math/.libs/asinhq.o
 math/.libs/hypotq.o math/.libs/remainderq.o math/.libs/asinq.o
math/.libs/rintq
.o math/.libs/atan2q.o math/.libs/isinfq.o math/.libs/roundq.o
math/.libs/atanhq
.o math/.libs/isnanq.o math/.libs/scalblnq.o math/.libs/atanq.o
math/.libs/j0q.o math/.libs/scalbnq.o math/.libs/cbrtq.o math/.libs/j1q.o
math/.libs/signbitq.o math/.libs/ceilq.o math/.libs/jnq.o
math/.libs/sincos_table.o math/.libs/complex.o math/.libs/ldexpq.o
math/.libs/sincosq.o math/.libs/copysignq.o math/.libs/lgammaq.o
math/.libs/sincosq_kernel.o math/.libs/coshq.o math/.libs/llroundq.o
math/.libs/sinhq.o math/.libs/cosq.o math/.libs/log10q.o math/.libs/sinq.o
math/.libs/cosq_kernel.o math/.libs/log1pq.o math/.libs/sinq_kernel.o
math/.libs/erfq.o math/.libs/logq.o math/.libs/sqrtq.o math/.libs/expm1q.o
math/.libs/lroundq.o math/.libs/tanhq.o math/.libs/expq.o math/.libs/modfq.o
math/.libs/tanq.o math/.libs/fabsq.o math/.libs/nanq.o math/.libs/tgammaq.o
math/.libs/finiteq.o math/.libs/nextafterq.o math/.libs/truncq.o
math/.libs/floorq.o math/.libs/powq.o math/.libs/fmaq.o math/.libs/logbq.o
math/.libs/exp2q.o math/.libs/issignalingq.o math/.libs/lgammaq_neg.o
math/.libs/lgammaq_product.o math/.libs/tanq_kernel.o
math/.libs/tgammaq_product.o math/.libs/casinhq_kernel.o math/.libs/cacoshq.o
math/.libs/cacosq.o math/.libs/casinhq.o math/.libs/casinq.o
math/.libs/catanhq.o math/.libs/catanq.o math/.libs/cimagq.o math/.libs/conjq.o
math/.libs/cprojq.o math/.libs/crealq.o math/.libs/fdimq.o math/.libs/fmaxq.o
math/.libs/fminq.o math/.libs/ilogbq.o math/.libs/llrintq.o math/.libs/log2q.o
math/.libs/lrintq.o math/.libs/nearbyintq.o math/.libs/remquoq.o
math/.libs/ccoshq.o math/.libs/cexpq.o math/.libs/clog10q.o math/.libs/clogq.o
math/.libs/csinq.o math/.libs/csinhq.o math/.libs/csqrtq.o math/.libs/ctanq.o
math/.libs/ctanhq.o printf/.libs/addmul_1.o printf/.libs/add_n.o
printf/.libs/cmp.o printf/.libs/divrem.o printf/.libs/flt1282mpn.o
printf/.libs/fpioconst.o printf/.libs/lshift.o printf/.libs/mul_1.o
printf/.libs/mul_n.o printf/.libs/mul.o printf/.libs/printf_fphex.o
printf/.libs/printf_fp.o printf/.libs/quadmath-printf.o printf/.libs/rshift.o
printf/.libs/submul_1.o printf/.libs/sub_n.o strtod/.libs/strtoflt128.o
strtod/.libs/mpn2flt128.o strtod/.libs/tens_in_limb.o   -lm -lc 
-Wl,--version-script=../../../gcc/libquadmath/quadmath.map   -Wl,-soname
-Wl,libquadmath.sl.0 -o .libs/libquadmath.sl.0.0
/opt/gnu64/bin/ld: warning: /lib/pa20_64/libm.sl has a section extending past
end of file
/opt/gnu64/bin/ld: /lib/pa20_64/libm.sl: .dynsym local symbol at index 0 (>=
sh_info of 0)
/opt/gnu64/bin/ld: /lib/pa20_64/libm.sl: .dynsym local symbol at index 1 (>=
sh_info of 0)
/opt/gnu64/bin/ld: /lib/pa20_64/libm.sl: .dynsym local symbol at index 2 (>=
sh_info of 0)
/opt/gnu64/bin/ld: /lib/pa20_64/libm.sl: .dynsym local symbol at index 3 (>=
sh_info of 0)
/opt/gnu64/bin/ld: warning: /lib/pa20_64/libc.sl has a section extending past
end of file
/opt/gnu64/bin/ld: /lib/pa20_64/libc.sl: .dynsym local symbol at index 0 (>=
sh_info of 0)
/opt/gnu64/bin/ld: /lib/pa20_64/libc.sl: .dynsym local symbol at index 1 (>=
sh_info of 0)
/opt/gnu64/bin/ld: /lib/pa20_64/libc.sl: .dynsym local symbol at index 2 (>=
sh_info of 0)
/opt/gnu64/bin/ld: /lib/pa20_64/libc.sl: .dynsym local symbol at index 3 (>=
sh_info of 0)
/opt/gnu64/bin/ld: math/.libs/sincos_table.o: invalid string offset 58 >= 32
for section `.strtab'
collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core
dumped
compilation terminated.
make[3]: *** [Makefile:829: libquadmath.la] Error 1

(gdb) frame 1
#1  0x400fa1b4 in bfd_elf_link_record_local_dynamic_symbol (
info=0x80010001b238 , input_bfd=0x8001001db158,
input_indx=44) at ../../src/bfd/elflink.c:841
841   dynstr_index = _bfd_elf_strtab_add (dynstr, name, false);
(gdb) p *entry
$1 = {next = 0x0, input_bfd = 0x0, input_indx = 0, dynindx = 0, isym = {
st_value = 64, st_size = 0, st_name = 58, st_info = 0 '\000',
st_other = 0 '\000', st_target_internal = 0 '\000', st_shndx = 4}}

bash-5.1$ readelf -at
./hppa64-hp-hpux11.11/libquadmath/math/.libs/sincos_table.o
ELF Header:
  Magic:   7f 45 4c 46 02 02 01 01 01 00 00 00 00 00 00 00
  Class: ELF64
  Data:  2's complement, big endian
  Version:   1 (current)
  OS/ABI:UNIX - HP-UX

[Bug ld/29802] Segmentation fault in _bfd_elf_strtab_add

2022-11-18 Thread danglin at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=29802

--- Comment #4 from John David Anglin  ---
Created attachment 14463
  --> https://sourceware.org/bugzilla/attachment.cgi?id=14463=edit
Patch

For reference, I have this patch installed to fix a problem with OTHER_SYMBOLS.
The symbols __SYSTEM_ID through __TLS_PREALLOC_DTV_A are undefined in crt0.o.
HP ld provides these.

The symbols __SYSTEM_ID_D through __systab are undefined in libc.sl. HP ld
does not provide them. It ignores them. My understanding is they are likely
set by the kernel. I provided them because GNU ld default behavior is to
error on undefined shared library symbols.

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


[Bug ld/29802] Segmentation fault in _bfd_elf_strtab_add

2022-11-18 Thread dave.anglin at bell dot net
https://sourceware.org/bugzilla/show_bug.cgi?id=29802

--- Comment #3 from dave.anglin at bell dot net ---
On 2022-11-18 4:30 p.m., dave.anglin at bell dot net wrote:
> readelf: Warning: [ 4]: Link field (0) should index a symtab section.
Sorry, cut this off:

   [ 3] .dynstr   STRTAB   40001940  1940
    0c41     A   0 0 1
readelf: Warning: [ 4]: Link field (0) should index a symtab section.
   [ 4] .hash HASH 40002588  2588
    0740     A   0 0 8

  0x0004 (HASH)   0x40002588

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


[Bug ld/29802] Segmentation fault in _bfd_elf_strtab_add

2022-11-18 Thread dave.anglin at bell dot net
https://sourceware.org/bugzilla/show_bug.cgi?id=29802

--- Comment #2 from dave.anglin at bell dot net ---
On 2022-11-18 3:51 p.m., amodra at gmail dot com wrote:
> https://sourceware.org/bugzilla/show_bug.cgi?id=29802
>
> --- Comment #1 from Alan Modra  ---
> What sort of local symbol are you trying to make dynamic?  A section symbol?
I'd have to debug more to be certain but when I dump a shared library generated
using HP ld
I see the following messages:

Section Headers:
   [Nr] Name  Type Address   Offset
    Size  EntSize  Flags  Link  Info  Align
   [ 0]   NULL   
         0 0 0
   [ 1] .dynamic  DYNAMIC  41c8  01c8
    01a0  0010   A   3 0 8
   [ 2] .dynsym   DYNSYM   4368  0368
    15d8  0018   A   3 0 8
   [ 3] .dynstr   STRTAB   40001940  1940
    0c41     A   0 0 1
readelf: Warning: [ 4]: Link field (0) should index a symtab section.
...
Symbol table '.dynsym' contains 233 entries:
    Num:    Value  Size Type    Bind   Vis  Ndx Name
  0:  0 NOTYPE  LOCAL  DEFAULT  UND
readelf: Warning: local symbol 0 found at index >= .dynsym's sh_info value of 0
  1: 41c8 0 SECTION LOCAL  DEFAULT    1 __text_seg
readelf: Warning: local symbol 1 found at index >= .dynsym's sh_info value of 0
  2: 8001 0 SECTION LOCAL  DEFAULT   20 __data_seg
readelf: Warning: local symbol 2 found at index >= .dynsym's sh_info value of 0
  3: 80013238 0 SECTION LOCAL  DEFAULT   39
__thread_specific_seg
readelf: Warning: local symbol 3 found at index >= .dynsym's sh_info value of 0
  4: 80011910    96 FUNC    GLOBAL DEFAULT   19 __lshrti3

I see these in links as well.

/opt/gnu64/bin/ld: warning: /lib/pa20_64/libc.sl has a section extending past
end of file
/opt/gnu64/bin/ld: /lib/pa20_64/libc.sl: .dynsym local symbol at index 0 (>=
sh_info of 0)
/opt/gnu64/bin/ld: /lib/pa20_64/libc.sl: .dynsym local symbol at index 1 (>=
sh_info of 0)
/opt/gnu64/bin/ld: /lib/pa20_64/libc.sl: .dynsym local symbol at index 2 (>=
sh_info of 0)
/opt/gnu64/bin/ld: /lib/pa20_64/libc.sl: .dynsym local symbol at index 3 (>=
sh_info of 0)
/opt/gnu64/bin/ld: /usr/lib/pa20_64/libdl.1: .dynsym local symbol at index 0
(>= sh_info of 0)
/opt/gnu64/bin/ld: /usr/lib/pa20_64/libdl.1: .dynsym local symbol at index 1
(>= sh_info of 0)
/opt/gnu64/bin/ld: /usr/lib/pa20_64/libdl.1: .dynsym local symbol at index 2
(>= sh_info of 0)
/opt/gnu64/bin/ld: /usr/lib/pa20_64/libdl.1: .dynsym local symbol at index 3
(>= sh_info of 0)

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


[Bug ld/29802] Segmentation fault in _bfd_elf_strtab_add

2022-11-18 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=29802

--- Comment #1 from Alan Modra  ---
What sort of local symbol are you trying to make dynamic?  A section symbol?

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