C6X: Keep OS/ABI when running strip

Bernd Schmidt bernds@codesourcery.com
Mon Jun 27 16:50:00 GMT 2011


On 06/27/11 17:53, Joseph S. Myers wrote:
> On Mon, 27 Jun 2011, Bernd Schmidt wrote:
> 
>> This is a fixlet for a problem introduced with the patch that made us
>> set OS/ABI to C6X-specific values. strip and objcopy changed the value
>> back to the default. Ok?
> 
> What happens if you strip a .o file (--strip-debug, say, is a useful case 
> of stripping .o files) with this patch? That shouldn't add an OSABI.

It doesn't. As far as I can tell the input OS/ABI field is used to
select a BFD target vector, so we then preserve it since we use the same
one for the output.

> It would be good to have testcases that 
> verify that strip preserves the OSABI for executables and shared libraries 
> and leaves it unset of .o files - maybe make the existing OSABI tests 
> strip the objects after first testing their OSABI and report the results 
> of testing OSABI after strip as well (with a different test name after 
> PASS or FAIL, of course).

There are some objcopy tests of that sort already in binutils/testsuite;
one of them (the plain objcopy one) would have caught the problem if it
was run for tic6x-uclinux. (Remember our discussion of -uclinux vs
-linux-uclibc? This is one more instance where "-uclinux" is interpreted
to mean "uses crummy flat binaries".)

The patch below enables the extra tests on tic6x-uclinux, and adds some
code to test OS/ABI fields before/after strip.


Bernd
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: bu-osabi.diff
URL: <https://sourceware.org/pipermail/binutils/attachments/20110627/30c07416/attachment.ksh>


More information about the Binutils mailing list