This is the mail archive of the 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: How to add 'relaxing' to loader for m68k

On Wed, Apr 10, 2002 at 10:06:05AM -0400, Peter Barada wrote:
> >> I think I'll have to add a special
> >> reloc type that indicates the instruction is a 'move', 'pea', or 'bsr'
> >> as well as mark pc-relative reloaction on everthing that can enclose
> >> one of these relaxable types.
> >
> >I presume because for a given reloc, you have differing offsets to the
> >start of instructions that may use that reloc.  Ick.  New relocs mean
> >your object is no longer ABI compliant, if that matters.  Perhaps a
> >better idea might be to create a special section with your extra
> >relaxing info.
> Are there any examples in gas/ld of using a special section for this?
> I'm looking for a place to start.

elfxx-mips.c does horrible things with extra sections.  Before you go
down that path though, I suggest implementing something using special
relocs to indicate the start of the insn as well as the relocs type.
The idea being to get your relaxation machinery working first, then
at a later stage write code for the assembler to map special relocs
to normal relocs + aux data stored in a special section, and code to
do the reverse in the linker.

Alan Modra
IBM OzLabs - Linux Technology Centre

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