[SPAM] Re: [PATCH] hppa64-hpux: Create dummy milli.a archives for binutils and ld testsuites [v2]

John David Anglin dave.anglin@bell.net
Wed Apr 15 23:28:06 GMT 2026


On 2026-04-15 1:10 p.m., Maciej W. Rozycki wrote:
> On Mon, 6 Apr 2026, John David Anglin wrote:
> 
>> In v2, I reworked the change to default.exp in the binutils testsuite to
>> avoid usings procs from the ld testsuite.
>>
>> Tested on hppa64-hp-hpux11.11 and x86_64-pc-linux-gnu.  Fixes all fails
>> due to missing milli.a archive.
> 
>  I can see:
> 
> hppa64-hp-hpux11.23  -FAIL: objcopy executable (pr25662)

This test now passes.

> hppa64-hp-hpux11.23  +FAIL: ld-elf/pr30791b

Note I said "Fixes all fails due to missing milli.a archive".  There are
about 23 fails on x86_64-pc-linux-gnu for the hppa64-hpux target which I
haven't had time to investigate.  There are more fails on hpux.  I see about
59 ld fails on alpha-vms.

I believe this fail is caused by the following:

static void
hppa64elf_after_parse (void)
{
  /* Stop the linker merging .text sections on relocatable links.  */
  if (bfd_link_relocatable (&link_info))
    lang_add_unique (".text");

This was done in preparation for improved stub support for long branches.
The above was taken from the 32-bit hppaelf.em file.  Maybe there is a better
way?

The pr30791b.d file has:
#source: pr30791c.s
#source: pr30791d.s
#ld: -r
#readelf: -S --wide
#xfail: hppa-*-* z80-*-*
# hppa fails since .text sections aren't merged for relocatable link.

The xfail isn't correct, and doesn't handle hppa64 or other 32-bit target
names (e.g., hppa2.0).

> hppa64-hp-hpux11.23  +FAIL: relocatable with script

This fails for the same reason.  The relocatable.d has:
#name: relocatable with script
#source: simple.s
#ld: -r -T relocatable.t
#readelf: -S --wide
#xfail: hppa-*-* hppa[12]*-*-*
> compared to commit 77cb5ee0f268 ("gas: pru: Add flag to select core 
> revision") after which linking `milli.a' was added; I hope it's expected.
> 
>> 2026-04-04  John David Anglin  <danglin@gcc.gnu.org>
>>
>> binutils/ChangeLog:
>>
>> 	* testsuite/config/default.exp: Create dummy missing
>> 	libraries for hppa*64-*-hpux* target.  Append
>> 	" -Ltmpdir" to LDFLAGS.
>>
>> ld/ChangeLog:
>>
>> 	* testsuite/config/default.exp: Create dummy missing
>> 	libraries for hppa*64-*-hpux* target.  Append
>> 	" -Ltmpdir" to LDFLAGS.
>> 	* testsuite/lib/ld-lib.exp (default_ld_link): Append
>> 	LDFLAGS to flags variable.
> 
>  Hmm, I think it would be safer long-term (even if nothing breaks right 
> away) if our dummy `milli.a' library lived on its own in a separate 
> directory such as `tmpdir/milli' that isn't expected to be ever used by 
> any tests, in particular generic ones.  This way adding " -Ltmpdir/milli" 
> won't interfere with tests that want or don't want to have `tmpdir' in the 
> library search path for some reason.

Will adjust change.  Maybe it's better to use "hppa" instead of "milli"
for the directory name?  That would work better on alpha.  I don't know
the names of the libraries that are always linked against on alpha-vms.
>  I can see `alpha*-*-*vms*' already uses " -Ltmpdir", so we have previous 
> art, but I'd rather fix it (separately, definitely an expectation for you 
> to do it) than add another case.
> 
>> diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
>> index d37d33cd96c..d1b6f2e058f 100644
>> --- a/ld/testsuite/lib/ld-lib.exp
>> +++ b/ld/testsuite/lib/ld-lib.exp
>> @@ -231,11 +231,13 @@ proc get_board_flags {} {
>>  proc default_ld_link { ld target objects } {
>>      global host_triplet
>>      global exec_output
>> +    global LDFLAGS
>>  
>>      set flags ""
>>      if [is_endian_output_format $objects] then {
>>  	set flags [big_or_little_endian]
>>      }
>> +    set flags "$flags $LDFLAGS"
> 
>  Why is this addition required for `hppa*64-*-hpux*' while not for 
> `alpha*-*-*vms*'?

This addition fixes the following tests for hppa64-hp-hpux11.11 on x86_64-pc-linux-gnu:

-FAIL: Link eh-group.o to eh-group
+PASS: Link eh-group.o to eh-group

-FAIL: assignment of ELF sections to segments (same page)
-FAIL: assignment of ELF sections to segments (adjacent pages)
-FAIL: assignment of ELF sections to segments (disjoint pages)
+PASS: assignment of ELF sections to segments (same page)
+PASS: assignment of ELF sections to segments (adjacent pages)
+PASS: assignment of ELF sections to segments (disjoint pages)

-FAIL: ALIGNOF
+PASS: ALIGNOF

-FAIL: section-flags-1
-FAIL: section-flags-2
+PASS: section-flags-1
+PASS: section-flags-2

 PASS: ld-scripts/section-match-1

-FAIL: weak undefined data symbols
-FAIL: weak undefined function symbols in shared lib
+PASS: weak undefined data symbols
+PASS: weak undefined function symbols in shared lib
+PASS: weak undefined function symbols in dynamic exe

For example in the eh-group.o test, we have without the addition:

./ld-new   -o tmpdir/eh-group -e _start tmpdir/eh-group.o
Executing on host: sh -c {./ld-new   -o tmpdir/eh-group -e _start tmpdir/eh-group.o 2>&1}  /dev/null ld.tmp (timeout = 300)
spawn [open ...]
/home/dave/gnu/binutils/objdir64/ld/ld-new: cannot find milli.a: No such file or directory
/home/dave/gnu/binutils/objdir64/ld/ld-new: cannot find milli.a: No such file or directory

FAIL: Link eh-group.o to eh-group

That's why I added the above addition.

The change didn't affect the test results for alpha-vms on x86_64-pc-linux-gnu.

Dave
-- 
John David Anglin  dave.anglin@bell.net


More information about the Binutils mailing list