This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] ld: Failing to copy processor specific flags for split-by-file


I believe that I have found a problem when using processor specific
flags while also using the -split-by-file option to the linker.

I create two files, each with a section called "foo" and set the same
processor specific flag on both of these sections.
I assemble and link these files, using the -split-by-file option to
the linker.
I would expect to see two sections in the output file, one called
".foo", and one called ".foo.0", each with the processor specific flag
set. Instead the flag is set on ".foo", but unset on ".foo.0".

I found this bug while working on a private port of binutils, for a
platform that use processor specific flags. 
As this looks like a generic issue I've created a test case for this
using an x86-64 target, setting the "l" flag on the sections.

I've attached two patches, split-test.patch, contains the test that
highlights this problem. I'll be honest, I don't really understand
what the "l" flag is used for, but I don't *think* that it makes any
difference for the purpose of this test, please let me know if I've
missed something obvious here :)

The second patch, split.patch, is my attempt at fixing the problem by
calling bfd_copy_private_section_data in clone_section to get the
required data copied over.

Let me know if there's anything else I need change or fix before the
patch could be considered for inclusion.

Thanks

Andrew

Attachment: split-test.patch;size=3626;creation-date="Wed,
Description: split-test.patch

Attachment: split.patch;size=527;creation-date="Wed,
Description: split.patch


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]