OSDN Git Service

This patch adds m68k support for elf2flt -a. I've tested it with
authorGreg Ungerer <gerg@snapgear.com>
Mon, 10 Jul 2006 06:00:41 +0000 (06:00 +0000)
committerGreg Ungerer <gerg@snapgear.com>
Mon, 10 Jul 2006 06:00:41 +0000 (06:00 +0000)
commit6287aafe2328d6622912224c2a08f6a94821a1e7
treeae4a377e28061c8ed1c47486f8ce0821414c62b7
parentce75bcd8139fe1401809b7831dbacaddc75b109a
This patch adds m68k support for elf2flt -a.  I've tested it with
load-to-RAM, -msep-data PIC-with-GOT and -mshared-library PIC-with-GOT.

Like ARM, but unlike V850, the new code errors out on relocs it doesn't
understand, rather than assuming that they're 32-bit fields.

It seems likely that every port that supports -a will want to print the
"reloc type not supported in this context" message; we've got two copies
already, and m68k would add a third.  I've therefore moved the v850
"bad_v850_reloc_err:" code outside the #ifdef and renamed the label to
the more neutral "bad_resolved_reloc:".  I've also changed the ARM code
to use this now-common code instead of its own copy.

In a similar vein, I've changed the default 32-bit field handling
so that it is the target of a new label, "good_32bit_resolved_reloc:".
The generic and v850 code can then jump to this code in their default
cases, while m68k can jump to it for R_68K_32 relocs.

The patch was written before Shaun Jackman made -p and -a work together:

    http://mailman.uclinux.org/pipermail/uclinux-dev/2006-June/039029.html

I'd been using this hunk too, but as well as guarding:

    q->address += got_size;

with "!use_resolved", I'd guarded the calculation of got_size itself,
as the value isn't otherwise used.  I've kept this additional check
in the attached patch.  Please apply if OK.

Signed-off-by: Richard Sandiford <richard@codesourcery.com>
elf2flt.c