This is the mail archive of the binutils@sources.redhat.com 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]

Re: Adding a MIPS -msym32 option


Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de> writes:
> Richard Sandiford wrote:
> [snip]
>> The patch adds two new .set directives:
>> 
>>         .set    sym32
>>         .set    nosym32
>> 
>> for changing the assumed sizes of symbolic constants.  It also adds
>> two new command-line options, -msym32 and -mno-sym32, for changing
>> the start-of-file setting.  See the attached docs for more details.
>
> Not that I were opposed to it, but when would those directives ever
> be used? A kernel compiled with sym32 never links in nosym32 parts.

Right.  I don't know of a specific instance in which the new directives
would be useful.  The reason I added them was that we use the "32-bitness"
of symbols as a local per-insn property, just like we do with things
like ISA selection.  Since we have .set directives for changing the ISA,
it seemed more consistent to have them for changing the symbol size
as well.  There might, for example, be cases where you want to define
an I/O-based symbol at link time and use something like:

        .set nosym32
        dla     $4,IO_BASE
        .set sym32
or:
        .set push
        .set nosym32
        dla     $4,IO_BASE
        .set pop

Unlikely, I agree ;).  But at the end of the day, it was so trivially
easy to provide this extra bit of flexibility that I thought "why not?".

> Ok, with one minor addition:

Thanks.

> [...]
> Splitting out the constant case...
> [...]
>>  	    {
>>  	      if (offset_expr.X_op == O_symbol
>
> ... makes this O_symbol check obsolete as well.

Good catch.  Installed with that change, and with one instance of
"!HAVE_64BIT_ADDRESSES" changed to "HAVE_32BIT_ADDRESSES".

Richard


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