[Bug ld/30732] ld: 'ELF weak (alias)' tests fail on hppa

2023-08-14 Thread danglin at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=30732

--- Comment #15 from John David Anglin  ---
dave@mx3210:~/gnu/binutils/objdir/ld$ gdb tmpdir/alias
GNU gdb (Debian 13.2-1) 13.2
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "hppa-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from tmpdir/alias...
(gdb) p/x psym1
$1 = 0x11198
(gdb) x/d psym1
0x11198 : 0
(gdb) break main
Breakpoint 1 at 0x10410: file
/home/dave/gnu/binutils/src/ld/testsuite/ld-elfweak/aliasmain.c, line 8.
(gdb) r
Starting program: /home/dave/gnu/binutils/objdir/ld/tmpdir/alias
warning: Unable to find libthread_db matching inferior's thread library, thread
debugging will not be available.

Breakpoint 1, 0x00010410 in main ()
at /home/dave/gnu/binutils/src/ld/testsuite/ld-elfweak/aliasmain.c:8
8   {
(gdb) info shared
>FromTo  Syms Read   Shared Object Library
0xfae4cec0  0xfae72494  Yes (*) /lib/ld.so.1
0xfaa5741c  0xfaa576f8  Yes tmpdir/alias.so
0xfa28b560  0xfa3e2404  Yes (*) /lib/hppa-linux-gnu/libc.so.6
(*): Shared library is missing debugging information.
(gdb) x/d psym1
0x11198 : 123
(gdb) c
Continuing.
value via psym1: 123, via psym2: 123, strong 123
[Inferior 1 (process 32061) exited normally]

dave@mx3210:~/gnu/binutils/objdir/ld$ nm tmpdir/alias
000105d4 t $$dyncall
0000 D $global$
0001100c d .LC0
00010744 r .Lpmain
00011010 d _DYNAMIC
00011184 A _GLOBAL_OFFSET_TABLE_
0001074c R _IO_stdin_used
 w _ITM_deregisterTMCloneTable
 w _ITM_registerTMCloneTable
00010828 r __FRAME_END__
000c D __TMC_END__
00010148 r __abi_tag
00011198 B __bss_start
000105e8 T __canonicalize_funcptr_for_compare
0000 D __data_start
0001058c t __do_global_dtors_aux
00011008 d __do_global_dtors_aux_fini_array_entry
0004 D __dso_handle
00011004 d __frame_dummy_init_array_entry
 w __gmon_start__
 U __libc_start_main@GLIBC_2.34
00011198 D _edata
000111a8 B _end
00010740 t _end_fini
000103dc t _end_init
00010724 T _fini
000103c4 T _init
00010458 T _start
0001119c b completed.0
0000 W data_start
000104f0 t deregister_tm_clones
000111a0 b fixup_plabel.0
000105c0 t frame_dummy
000104a0 t gmon_initializer
00010408 T main
ffec a mrp_slot
 U printf@GLIBC_2.2
0008 D psym1
000c D psym2
ffec a r31_slot
00010534 t register_tm_clones
fff0 a sr0_slot
00011198 B strongsym
00011198 V weaksym1
00011198 V weaksym2

I suspect you have a binding issue in ld.so.1.

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


[Bug ld/30732] ld: 'ELF weak (alias)' tests fail on hppa

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

--- Comment #14 from Sam James  ---
OK, I was wrong. I can reproduce it with our normal toolchain too.

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


[Bug ld/30732] ld: 'ELF weak (alias)' tests fail on hppa

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

--- Comment #13 from Sam James  ---
Fixed the pattern, thanks.

OK, back to alias.

I can reproduce it consistently, but only on this machine so far. This machine
is built with Gentoo's hardened profile, which has default
PIE/relro/binding/_FORTIFY_SOURC£=3, but interestingly, appending stuff to
negate relro/binding/_F_S doesn't help.

I'll have to look into it more to see what's causing it in my environment.

(gdb) p psym1
$1 = (int *) 0x0
(gdb) p psym2
$2 = (int *) 0x0
(gdb) p strongsym
$3 = 123
(gdb)

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


[Bug ld/30732] ld: 'ELF weak (alias)' tests fail on hppa

2023-08-10 Thread dave.anglin at bell dot net
https://sourceware.org/bugzilla/show_bug.cgi?id=30732

--- Comment #12 from dave.anglin at bell dot net ---
On 2023-08-10 12:25 a.m., sam at gentoo dot org wrote:
>> Let's leave things as they are for the moment.  I will test hppa64 builds on
>> linux and hpux.
> I'll fix the pattern over the weekend (it's trivial ofc, just going to add
> hppa1.1 and hppa2.0 explicitly for Gentoo, and restore the old hppa-* pattern)
> as Alan pointed out the change in results for hppa64.
You can cover both hppa1.1 and hppa2.0 with hppa[12]*.  hppa1.0 is
theoretically possible
but never used.

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


[Bug ld/30732] ld: 'ELF weak (alias)' tests fail on hppa

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

--- Comment #11 from Sam James  ---
(In reply to dave.anglin from comment #9)
> Let's leave things as they are for the moment.  I will test hppa64 builds on
> linux and hpux.

I'll fix the pattern over the weekend (it's trivial ofc, just going to add
hppa1.1 and hppa2.0 explicitly for Gentoo, and restore the old hppa-* pattern)
as Alan pointed out the change in results for hppa64.

> 
> I started hacking on glibc to support hppa64-linux but got waylaid.

I can't promise to be of enormous help (the main issue being I don't have the
parisc ABI burned into my brain yet), but please keep me posted and let me know
if I can do anything.

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


[Bug ld/30732] ld: 'ELF weak (alias)' tests fail on hppa

2023-08-09 Thread danglin at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=30732

--- Comment #10 from John David Anglin  ---
The ld test results for --target=hppa64-linux-gnu are:

FAIL: ld-elf/now-3
FAIL: ld-elf/pr19539
FAIL: ld-elf/pr19698
FAIL: PR ld/22269
FAIL: PR ld/22269 (-z dynamic-undefined-weak)
FAIL: Discarded dynamic relocation section
XPASS: relocatable with script
FAIL: DT_TEXTREL in shared lib
FAIL: DT_TEXTREL map file warning
FAIL: pr20995

So, the "relocatable with script" test result is changed from PASS to XPASS.

Need to review other test results.

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


[Bug ld/30732] ld: 'ELF weak (alias)' tests fail on hppa

2023-08-08 Thread dave.anglin at bell dot net
https://sourceware.org/bugzilla/show_bug.cgi?id=30732

--- Comment #9 from dave.anglin at bell dot net ---
Let's leave things as they are for the moment.  I will test hppa64 builds on
linux and hpux.

I started hacking on glibc to support hppa64-linux but got waylaid.

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


[Bug ld/30732] ld: 'ELF weak (alias)' tests fail on hppa

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

--- Comment #8 from Sam James  ---
(In reply to dave.anglin from comment #7)
> On 2023-08-08 3:33 p.m., sam at gentoo dot org wrote:
> > Thanks Dave, I've done that last night in
> > https://inbox.sourceware.org/binutils/871qgdto5m@gentoo.org/T/#m0f16fd340d16e17949f2153309606b0918d0b926.
> I think the xfail and notarget comments were written as they were so they
> didn't match hppa64.

I haven't yet got a testing setup for hppa64 (we have a package for it,
obviously, for building kernels, but I haven't tried to build it manually yet)
but I can revert my commits and replace with an explicit hppa1.1 and hppa2.0 if
you prefer.

But personally I'm not that focused on hppa64 just yet until we have the
userland stuff more figured out. Whatever you prefer.

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


[Bug ld/30732] ld: 'ELF weak (alias)' tests fail on hppa

2023-08-08 Thread dave.anglin at bell dot net
https://sourceware.org/bugzilla/show_bug.cgi?id=30732

--- Comment #7 from dave.anglin at bell dot net ---
On 2023-08-08 3:33 p.m., sam at gentoo dot org wrote:
> Thanks Dave, I've done that last night in
> https://inbox.sourceware.org/binutils/871qgdto5m@gentoo.org/T/#m0f16fd340d16e17949f2153309606b0918d0b926.
I think the xfail and notarget comments were written as they were so they
didn't match hppa64.

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


[Bug ld/30732] ld: 'ELF weak (alias)' tests fail on hppa

2023-08-08 Thread dave.anglin at bell dot net
https://sourceware.org/bugzilla/show_bug.cgi?id=30732

--- Comment #6 from dave.anglin at bell dot net ---
On 2023-08-08 3:33 p.m., sam at gentoo dot org wrote:
> Let me check if I can repeoduce the ELF weak (alias) failure.
The segv appears to be in printf.

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


[Bug ld/30732] ld: 'ELF weak (alias)' tests fail on hppa

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

--- Comment #5 from Sam James  ---
(In reply to dave.anglin from comment #4)
> Created attachment 15051 [details]
> ld-hppa.d
> 
> On 2023-08-08 12:16 p.m., danglin at gcc dot gnu.org wrote:
> > I see for GNU ld (GNU Binutils) 2.41.50.20230808:
> > XFAIL: relocatable with script
> > UNSUPPORTED: SHF_GNU_RETAIN 7a
> The xfail and notarget comments for these tests need adjusting for hppa2.0 .

Thanks Dave, I've done that last night in
https://inbox.sourceware.org/binutils/871qgdto5m@gentoo.org/T/#m0f16fd340d16e17949f2153309606b0918d0b926.

Let me check if I can repeoduce the ELF weak (alias) failure.

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


[Bug ld/30732] ld: 'ELF weak (alias)' tests fail on hppa

2023-08-08 Thread dave.anglin at bell dot net
https://sourceware.org/bugzilla/show_bug.cgi?id=30732

--- Comment #4 from dave.anglin at bell dot net ---
On 2023-08-08 12:16 p.m., danglin at gcc dot gnu.org wrote:
> I see for GNU ld (GNU Binutils) 2.41.50.20230808:
> XFAIL: relocatable with script
> UNSUPPORTED: SHF_GNU_RETAIN 7a
The xfail and notarget comments for these tests need adjusting for hppa2.0 .

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


[Bug ld/30732] ld: 'ELF weak (alias)' tests fail on hppa

2023-08-08 Thread danglin at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=30732

--- Comment #3 from John David Anglin  ---
I see for GNU ld (GNU Binutils) 2.41.50.20230808:
XFAIL: relocatable with script
UNSUPPORTED: SHF_GNU_RETAIN 7a
PASS: ELF weak (alias)

Is the segmentation fault in the ELF weak test reproducible?

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


[Bug ld/30732] ld: 'ELF weak (alias)' tests fail on hppa

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

Sam James  changed:

   What|Removed |Added

 CC||danglin at gcc dot gnu.org

--- Comment #2 from Sam James  ---
Dave, can you reproduce this one?

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


[Bug ld/30732] ld: 'ELF weak (alias)' tests fail on hppa

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

--- Comment #1 from Sam James  ---
Created attachment 15048
  --> https://sourceware.org/bugzilla/attachment.cgi?id=15048=edit
bad-alias-segfault.tar.xz

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