This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: ld --embedded-relocs for m68k
- To: msokolov at ivan dot Harhan dot ORG
- Subject: Re: ld --embedded-relocs for m68k
- From: Ian Lance Taylor <ian at zembu dot com>
- Date: 8 Jun 2000 13:31:08 -0700
- CC: binutils at sourceware dot cygnus dot com
- References: <0006081849.AA18407@ivan.Harhan.ORG>
Date: Thu, 8 Jun 00 13:49:11 CDT
From: msokolov@ivan.Harhan.ORG (Michael Sokolov)
Was the MIPS --embedded-relocs support intended to be general, or was it a
solution for some specific oddball embedded system?
It was a solution for a specific oddball embedded system: the General
Magic MagicLink system. General Magic started on the m68k, writing
relocateable code which could run on a Mac. They switched over to
MIPS, and wanted relocateable code there as well.
The problem with using a section index is that it implies that you
need a section table. Think about converting a program to S-records.
Whatever table you use must be recorded in the program image somehow.
For MIPS --embedded-relocs I split up text and data, and required the
linker script and the startup code to work in tandem to record that
information for proper relocation at run time. See
ld/testsuite/ld-empic/runtesti.s.
If you need to support multiple sections, you need a more complex
solution. If you need to support arbitrary numbers of sections, you
need to write a section table somewhere, perhaps at the start of the
relocation information. But I don't know how you pass in the runtime
addresses of the various sections. That is bound to be system
specific.
Ian