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]

Re: Draft SH uClinux FDPIC ABI


On Feb 26, 2008, "Joseph S. Myers" <joseph@codesourcery.com> wrote:

> Here is a draft FDPIC ABI for SH uClinux, based on the FR-V FDPIC ABI.  
> Please send any comments; CodeSourcery will be implementing the final ABI 
> version in GCC and Binutils.

Cool!  Great news!

> In the picture above, function descriptors are placed at negative
> offsets relative to R12 and the GOT data address entries are placed at
> positive offsets relative to R12.  The link editor is free to place
> either the function descriptors at positive offsets (subject to
> alignment constraints) or the data address entries at negative
> offsets.  Also, note that there is no requirement that the function
> descriptors or data address entries have any particular grouping.

It was the need for using the atomic 64-bit load/store instructions
that motivated us to use 64-bit alignment for function descriptors on
FR-V.  Since SH doesn't have 64-bit load/store instructions, there's
no need for function descriptors to be aligned to 64-bit boundaries.

It was the different alignment of function descriptors and other
pointers in the GOT, and the fact that the reserved area had an odd
number of words, that motivated us to suggest the arrangement of
negative even-word offsets for descriptors and positive
even-or-odd-word offsets for other pointers.  Since you have relax the
alignment requirements for descriptors (I don't see it mandated
anywhere), you might as well leave the placement of descriptors and
other pointers completely free.  I think this could greatly simplify
the implementation of the linker.  If you look at the trouble I had to
try to accommodate 12-bit, 16-bit and 32-bit offsets without
overflowing the narrower offsets if at all possible, you'll probably
quickly change your mind about it.  Although you may want to optimize
for immediate offsets, 20-bit offsets and 32-bit offsets as well, so
you may sort of be on the same boat, at least for SH-2A.  Fun! :-)

> This arrangement will not make processes that the debugger attaches to
> after they are mapped in look like they have independent sets of
> breakpoints; they may just crash instead of they reach a breakpoint
> instruction set with ptrace for another process.

Typo (carried over from the original): instead of => instead, if

I've just fixed it in FR-V FDPIC 1.0b.

-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
FSF Latin America Board Member         http://www.fsfla.org/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}


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