This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: Add MIPS -mno-shared support


Daniel Jacobowitz <drow@false.org> writes:
>> >  - We can't assume that functions in other objects were compiled
>> >    with -mno-shared, so the criterion for direct calls is
>> >    "locally-defined" rather than "locally-binding".
>
> Should there be an option to assume locally-binding?  I'm sure some
> embedded systems builders would be happy - especially some time from
> now when usage has become more common.

Yeah, I wondered about that too, but I think we should only do it if we
add an ELF flag.  I don't like the sound of things like...

> The linker should be able to warn about a mismatch - it will see the
> direct j/jal relocation, and the old GOT load sequence.

...all that much.  And I agree we'd need the linker to detect mismatches
_somehow_.  It would be far too easy to make mistakes otherwise.

Also, even if -mno-shared usage does become more common in future,
the change we're talking about would only make a difference if the user
carefully marks every locally-binding but not locally-defined function
with some visibility attribute, so that we know at compile time that
we can call it directly.  I wonder if that practice will become common
enough for the extra complication to pay off?  I wasn't really convinced.

Richard


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