This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH 2/4] LD: Support fixed-size sections some psABIs may require
- From: "Maciej W. Rozycki" <macro at mips dot com>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: <binutils at sourceware dot org>, Vlad Ivanov <vlad@ivanov.email>
- Date: Mon, 5 Feb 2018 15:01:10 +0000
- Subject: Re: [PATCH 2/4] LD: Support fixed-size sections some psABIs may require
- Authentication-results: sourceware.org; auth=none
- References: <alpine.DEB.2.00.1801302217320.4074@tp.orcam.me.uk> <alpine.DEB.2.00.1801312116210.4191@tp.orcam.me.uk> <37b319d8-f586-c549-2eaa-e55bf3736488@redhat.com>
Hi Nick,
> > Define a SEC_FIXED_SIZE section flag for target backends to use for
> > output sections whose size has been fixed in the psABI. The size of
> > such sections will not be changed anyhow by the generic linker and it is
> > up to the target backend to get their size right.
>
> One thing that worries me is - should the linker issue a warning/error
> message if the user does attempt to change the size of a fixed-size section ?
> Or maybe only issue the message if the size change would make the section
> bigger than is allowed ?
An error would defeat the purpose of this change, as what the change does
is to ensure the size is fixed, by truncating or padding out the section
concerned as required. We currently abort, with an error, in the MIPS
backend if one of the fixed-size sections turns out not to have the right
size, and this patch changes it.
A warning might make sense, although given how linker processing is done
it would require keeping track of section size update attempts and only
issue the warning if the final one ends up with a size mismatch. I'll see
if I can look into it, but given my other commitments right now I may not
be able to do anything about it.
> Hmm, actually, going one step further - do we need to support a FIXED_SIZE(<vale>)
> section attribute for linker scripts, so that these sections can be defined
> there too ?
I don't know, I would have to think about a use case. Maybe someone else
can chime in.
Maciej