bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/25677] Changes to --*magic options for pdp11-aout target


From: casner at acm dot org
Subject: [Bug ld/25677] Changes to --*magic options for pdp11-aout target
Date: Sun, 05 Apr 2020 05:03:24 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=25677

--- Comment #8 from Stephen Casner <casner at acm dot org> ---
(In reply to Nick Clifton from comment #5)
>   The important issue is the extract symbols failure in the script.exp tests:
> 
>     Running ../../ld/testsuite/ld-scripts/script.exp ...
>     [...]
>     FAIL: extract symbols
> 
> According to my logs this failure is new.  Ie it only happens after applying
> your patch.

The aspect of my patch that exposed this failure is the change of the default
output format to --omagic.  The test would have failed for the code without my
patch if the previous test had done "ld --omagic -o script script.o".

The code that produces the erroneous data section size 4 rather than 0 is in
bfd/pdp11.c function adjust_o_magic().  It was changed as part of the recent
commit dda2980f54a by Alan Modra to fix PR 25569, but I'm not asserting that
this commit was incorrect.  I'm not sure what should change.

For the failing test in question, objcopy is invoked with option
--extract-symbol which should reduce the text and data sections to zero length.
 In the output bfd section structures the size is set to zero but the VMAs are
not.  Because objcopy also sets the user_set_vma flag to true, that causes the
code in adjust_o_magic() to see that the difference between the vmas for data
and bss is 4 while the size of data is 0, so it adds a padding of 4 to the data
size.  That's what comes out as 4 in the a.out header.

Should objcopy also set the VMAs to zero?  Or should it not set the
user_set_vma flags?

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]