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:
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>