This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: RFC: section merge test (ld-elf)
- From: Nick Clifton <nickc at redhat dot com>
- To: "Sivanupandi, Pitchumani" <Pitchumani dot Sivanupandi at atmel dot com>, "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Tue, 3 May 2016 11:26:30 +0100
- Subject: Re: RFC: section merge test (ld-elf)
- Authentication-results: sourceware.org; auth=none
- References: <CAC140656783604CABA6AE60C2A6D5A4CA3F3527 at penmbx01>
Hi Sivanupandi,
> Test flags1.s expects output (after objcopy) have one program header. But
> sections are merged to a segment while linking itself (same for native
> as well). Is that expected from this testcase?
> Is that testcase intended to check merge of sections after objcopy with
> updated flags?
Yes and no. The purpose of the test is to check that the flags have
been changed for the .post_text_reserve section. It does this however,
in a rather roundabout way by checking to see if the .text section and
the .post_text_reserve_section have been combined into a single program
segment. (They were in separate segments before the objcopy because
they had incompatible flags. They can be merged into the same segment
after the objcopy because their flags are not compatible. This merging
does not have to happen though, it is only an optimization that the
linker is free to ignore).
If you want to remove the XFAIL for the AVR for this test, then that would
be fine with me. If you feel like more of a challenge, then rewriting
this test so that it passes "-S --wide" to readelf, instead of "-l --wide",
and then checks the section flags, would be a great way to improve the
test and make it work with a wider range of targets.
Cheers
Nick