add support for embedded relocs in m68k ELF port

This commit is contained in:
Nick Clifton 2000-09-15 18:52:52 +00:00
parent ffcb7aff0f
commit 0752970ef8
15 changed files with 754 additions and 418 deletions

View File

@ -1,3 +1,9 @@
2000-09-10 Michael Sokolov <msokolov@ivan.Harhan.ORG>
* elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): New function.
* bfd-in.h (bfd_m68k_elf32_create_embedded_relocs): Add declaration.
* bfd-in2.h: Regenerate.
2000-09-15 Kenneth Block <Kenneth.Block@compaq.com>
* bfd/elf64-alpha.c (elf64_alpha_relax_with_lituse): ld performs

View File

@ -81,6 +81,8 @@ DATADIRNAME = @DATADIRNAME@
DLLTOOL = @DLLTOOL@
EXEEXT = @EXEEXT@
EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
GCJ = @GCJ@
GCJFLAGS = @GCJFLAGS@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GT_NO = @GT_NO@

View File

@ -652,6 +652,10 @@ extern int bfd_get_arch_size PARAMS ((bfd *));
/* Return true if address "naturally" sign extends, or -1 if not elf. */
extern int bfd_get_sign_extend_vma PARAMS ((bfd *));
extern boolean bfd_m68k_elf32_create_embedded_relocs
PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *,
char **));
/* SunOS shared library support routines for the linker. */
extern struct bfd_link_needed_list *bfd_sunos_get_needed_list

View File

@ -652,6 +652,10 @@ extern int bfd_get_arch_size PARAMS ((bfd *));
/* Return true if address "naturally" sign extends, or -1 if not elf. */
extern int bfd_get_sign_extend_vma PARAMS ((bfd *));
extern boolean bfd_m68k_elf32_create_embedded_relocs
PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *,
char **));
/* SunOS shared library support routines for the linker. */
extern struct bfd_link_needed_list *bfd_sunos_get_needed_list
@ -1393,8 +1397,8 @@ enum bfd_architecture
#define bfd_mach_mips6000 6000
#define bfd_mach_mips8000 8000
#define bfd_mach_mips10000 10000
#define bfd_mach_mips16 16
#define bfd_mach_mips4K 32
#define bfd_mach_mips16 16
bfd_arch_i386, /* Intel 386 */
#define bfd_mach_i386_i386 0
#define bfd_mach_i386_i8086 1

527
bfd/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -81,6 +81,8 @@ DATADIRNAME = @DATADIRNAME@
DLLTOOL = @DLLTOOL@
EXEEXT = @EXEEXT@
EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
GCJ = @GCJ@
GCJFLAGS = @GCJFLAGS@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GT_NO = @GT_NO@

View File

@ -2179,6 +2179,144 @@ elf_m68k_finish_dynamic_sections (output_bfd, info)
return true;
}
/* Given a .data section and a .emreloc in-memory section, store
relocation information into the .emreloc section which can be
used at runtime to relocate the section. This is called by the
linker when the --embedded-relocs switch is used. This is called
after the add_symbols entry point has been called for all the
objects, and before the final_link entry point is called. */
boolean
bfd_m68k_elf32_create_embedded_relocs (abfd, info, datasec, relsec, errmsg)
bfd *abfd;
struct bfd_link_info *info;
asection *datasec;
asection *relsec;
char **errmsg;
{
Elf_Internal_Shdr *symtab_hdr;
Elf32_External_Sym *extsyms;
Elf32_External_Sym *free_extsyms = NULL;
Elf_Internal_Rela *internal_relocs;
Elf_Internal_Rela *free_relocs = NULL;
Elf_Internal_Rela *irel, *irelend;
bfd_byte *p;
BFD_ASSERT (! info->relocateable);
*errmsg = NULL;
if (datasec->reloc_count == 0)
return true;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
/* Read this BFD's symbols if we haven't done so already, or get the cached
copy if it exists. */
if (symtab_hdr->contents != NULL)
extsyms = (Elf32_External_Sym *) symtab_hdr->contents;
else
{
/* Go get them off disk. */
if (info->keep_memory)
extsyms = ((Elf32_External_Sym *)
bfd_alloc (abfd, symtab_hdr->sh_size));
else
extsyms = ((Elf32_External_Sym *)
bfd_malloc (symtab_hdr->sh_size));
if (extsyms == NULL)
goto error_return;
if (! info->keep_memory)
free_extsyms = extsyms;
if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0
|| (bfd_read (extsyms, 1, symtab_hdr->sh_size, abfd)
!= symtab_hdr->sh_size))
goto error_return;
if (info->keep_memory)
symtab_hdr->contents = extsyms;
}
/* Get a copy of the native relocations. */
internal_relocs = (_bfd_elf32_link_read_relocs
(abfd, datasec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
info->keep_memory));
if (internal_relocs == NULL)
goto error_return;
if (! info->keep_memory)
free_relocs = internal_relocs;
relsec->contents = (bfd_byte *) bfd_alloc (abfd, datasec->reloc_count * 12);
if (relsec->contents == NULL)
goto error_return;
p = relsec->contents;
irelend = internal_relocs + datasec->reloc_count;
for (irel = internal_relocs; irel < irelend; irel++, p += 12)
{
asection *targetsec;
/* We are going to write a four byte longword into the runtime
reloc section. The longword will be the address in the data
section which must be relocated. It is followed by the name
of the target section NUL-padded or truncated to 8
characters. */
/* We can only relocate absolute longword relocs at run time. */
if (ELF32_R_TYPE (irel->r_info) != (int) R_68K_32)
{
*errmsg = _("unsupported reloc type");
bfd_set_error (bfd_error_bad_value);
goto error_return;
}
/* Get the target section referred to by the reloc. */
if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info)
{
Elf_Internal_Sym isym;
/* A local symbol. */
bfd_elf32_swap_symbol_in (abfd,
extsyms + ELF32_R_SYM (irel->r_info),
&isym);
targetsec = bfd_section_from_elf_index (abfd, isym.st_shndx);
}
else
{
unsigned long indx;
struct elf_link_hash_entry *h;
/* An external symbol. */
indx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info;
h = elf_sym_hashes (abfd)[indx];
BFD_ASSERT (h != NULL);
if (h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
targetsec = h->root.u.def.section;
else
targetsec = NULL;
}
bfd_put_32 (abfd, irel->r_offset + datasec->output_offset, p);
memset (p + 4, 0, 8);
if (targetsec != NULL)
strncpy (p + 4, targetsec->output_section->name, 8);
}
if (free_extsyms != NULL)
free (free_extsyms);
if (free_relocs != NULL)
free (free_relocs);
return true;
error_return:
if (free_extsyms != NULL)
free (free_extsyms);
if (free_relocs != NULL)
free (free_relocs);
return false;
}
#define TARGET_BIG_SYM bfd_elf32_m68k_vec
#define TARGET_BIG_NAME "elf32-m68k"
#define ELF_MACHINE_CODE EM_68K

View File

@ -128,6 +128,7 @@ elf32-mips.c
elf32-pj.c
elf32-ppc.c
elf32-sh.c
elf32-sh-lin.c
elf32-sparc.c
elf32-v850.c
elf64-alpha.c

View File

@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2000-09-05 14:30-0700\n"
"POT-Creation-Date: 2000-09-15 11:44-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -54,16 +54,16 @@ msgstr ""
msgid "%s: relocateable link from %s to %s not supported"
msgstr ""
#: archive.c:1813
#: archive.c:1808
msgid "Warning: writing archive was slow: rewriting timestamp\n"
msgstr ""
#: archive.c:2079
#: archive.c:2074
msgid "Reading archive file mod timestamp"
msgstr ""
#. FIXME: bfd can't call perror.
#: archive.c:2103
#: archive.c:2098
msgid "Writing updated armap timestamp"
msgstr ""
@ -191,7 +191,7 @@ msgstr ""
msgid "GP relative relocation used when GP not defined"
msgstr ""
#: coff-alpha.c:1486 elf64-alpha.c:3994
#: coff-alpha.c:1486 elf64-alpha.c:4003
msgid "using multiple gp values"
msgstr ""
@ -199,129 +199,129 @@ msgstr ""
msgid "GP relative relocation when GP not defined"
msgstr ""
#: coff-arm.c:1020 elf32-arm.h:248
#: coff-arm.c:1017 elf32-arm.h:248
#, c-format
msgid "%s: unable to find THUMB glue '%s' for `%s'"
msgstr ""
#: coff-arm.c:1049 elf32-arm.h:283
#: coff-arm.c:1046 elf32-arm.h:283
#, c-format
msgid "%s: unable to find ARM glue '%s' for `%s'"
msgstr ""
#: coff-arm.c:1338 coff-arm.c:1433 elf32-arm.h:843 elf32-arm.h:948
#: coff-arm.c:1334 coff-arm.c:1429 elf32-arm.h:843 elf32-arm.h:948
#, c-format
msgid "%s(%s): warning: interworking not enabled."
msgstr ""
#: coff-arm.c:1342 elf32-arm.h:951
#: coff-arm.c:1338 elf32-arm.h:951
#, c-format
msgid " first occurrence: %s: arm call to thumb"
msgstr ""
#: coff-arm.c:1437 elf32-arm.h:846
#: coff-arm.c:1433 elf32-arm.h:846
#, c-format
msgid " first occurrence: %s: thumb call to arm"
msgstr ""
#: coff-arm.c:1440
#: coff-arm.c:1436
msgid " consider relinking with --support-old-code enabled"
msgstr ""
#: coff-arm.c:1729 coff-tic80.c:682 cofflink.c:2988
#: coff-arm.c:1725 coff-tic80.c:682 cofflink.c:2988
#, c-format
msgid "%s: bad reloc address 0x%lx in section `%s'"
msgstr ""
#: coff-arm.c:2067
#: coff-arm.c:2062
#, c-format
msgid "%s: illegal symbol index in reloc: %d"
msgstr ""
#: coff-arm.c:2196
#: coff-arm.c:2190
#, c-format
msgid "%s: ERROR: compiled for APCS-%d whereas target %s uses APCS-%d"
msgstr ""
#: coff-arm.c:2211
#: coff-arm.c:2205
#, c-format
msgid ""
"%s: ERROR: passes floats in float registers whereas target %s uses integer "
"registers"
msgstr ""
#: coff-arm.c:2214
#: coff-arm.c:2208
#, c-format
msgid ""
"%s: ERROR: passes floats in integer registers whereas target %s uses float "
"registers"
msgstr ""
#: coff-arm.c:2229
#: coff-arm.c:2223
#, c-format
msgid ""
"%s: ERROR: compiled as position independent code, whereas target %s is "
"absolute position"
msgstr ""
#: coff-arm.c:2232
#: coff-arm.c:2226
#, c-format
msgid ""
"%s: ERROR: compiled as absolute position code, whereas target %s is position "
"independent"
msgstr ""
#: coff-arm.c:2261
#: coff-arm.c:2255
#, c-format
msgid "Warning: input file %s supports interworking, whereas %s does not."
msgstr ""
#: coff-arm.c:2264
#: coff-arm.c:2258
#, c-format
msgid "Warning: input file %s does not support interworking, whereas %s does."
msgstr ""
#: coff-arm.c:2292
#: coff-arm.c:2285
#, c-format
msgid "private flags = %x:"
msgstr ""
#: coff-arm.c:2300 elf32-arm.h:2153
#: coff-arm.c:2293 elf32-arm.h:2154
msgid " [floats passed in float registers]"
msgstr ""
#: coff-arm.c:2302
#: coff-arm.c:2295
msgid " [floats passed in integer registers]"
msgstr ""
#: coff-arm.c:2305 elf32-arm.h:2156
#: coff-arm.c:2298 elf32-arm.h:2157
msgid " [position independent]"
msgstr ""
#: coff-arm.c:2307
#: coff-arm.c:2300
msgid " [absolute position]"
msgstr ""
#: coff-arm.c:2311
#: coff-arm.c:2304
msgid " [interworking flag not initialised]"
msgstr ""
#: coff-arm.c:2313
#: coff-arm.c:2306
msgid " [interworking supported]"
msgstr ""
#: coff-arm.c:2315
#: coff-arm.c:2308
msgid " [interworking not supported]"
msgstr ""
#: coff-arm.c:2364
#: coff-arm.c:2356
#, c-format
msgid ""
"Warning: Not setting interworking flag of %s, since it has already been "
"specified as non-interworking"
msgstr ""
#: coff-arm.c:2368
#: coff-arm.c:2360
#, c-format
msgid "Warning: Clearing the interworking flag of %s due to outside request"
msgstr ""
@ -395,7 +395,7 @@ msgstr ""
msgid "%s: warning: %s: line number overflow: 0x%lx > 0xffff"
msgstr ""
#: coff-m68k.c:477 coff-mips.c:2433
#: coff-m68k.c:477 coff-mips.c:2433 elf32-m68k.c:2267
msgid "unsupported reloc type"
msgstr ""
@ -550,20 +550,20 @@ msgid "%s: Warning: Thumb BLX instruction targets thumb function '%s'."
msgstr ""
#: elf-hppa.h:1363 elf-hppa.h:1396 elf32-arm.h:1832 elf32-i386.c:1430
#: elf32-ppc.c:3083 elf32-sh.c:2863
#: elf32-ppc.c:3083 elf32-sh.c:2997
#, c-format
msgid ""
"%s: warning: unresolvable relocation against symbol `%s' from %s section"
msgstr ""
#: elf-m10200.c:455 elf-m10300.c:670 elf32-arm.h:1901 elf32-avr.c:844
#: elf32-cris.c:423 elf32-d10v.c:479 elf32-fr30.c:651 elf32-i860.c:1021
#: elf32-cris.c:423 elf32-d10v.c:479 elf32-fr30.c:651 elf32-i860.c:1062
#: elf32-m32r.c:1265 elf32-v850.c:1677
msgid "internal error: out of range error"
msgstr ""
#: elf-m10200.c:459 elf-m10300.c:674 elf32-arm.h:1905 elf32-avr.c:848
#: elf32-cris.c:427 elf32-d10v.c:483 elf32-fr30.c:655 elf32-i860.c:1025
#: elf32-cris.c:427 elf32-d10v.c:483 elf32-fr30.c:655 elf32-i860.c:1066
#: elf32-m32r.c:1269 elf32-v850.c:1681
msgid "internal error: unsupported relocation error"
msgstr ""
@ -574,7 +574,7 @@ msgid "internal error: dangerous error"
msgstr ""
#: elf-m10200.c:467 elf-m10300.c:682 elf32-arm.h:1913 elf32-avr.c:856
#: elf32-cris.c:435 elf32-d10v.c:491 elf32-fr30.c:663 elf32-i860.c:1033
#: elf32-cris.c:435 elf32-d10v.c:491 elf32-fr30.c:663 elf32-i860.c:1074
#: elf32-m32r.c:1277 elf32-v850.c:1701
msgid "internal error: unknown error"
msgstr ""
@ -598,180 +598,180 @@ msgid ""
"%s has been linked with it"
msgstr ""
#: elf32-arm.h:2067
#: elf32-arm.h:2068
#, c-format
msgid ""
"Error: %s compiled for EABI version %d, whereas %s is compiled for version %d"
msgstr ""
#: elf32-arm.h:2079
#: elf32-arm.h:2080
#, c-format
msgid "Error: %s compiled for APCS-%d, whereas %s is compiled for APCS-%d"
msgstr ""
#: elf32-arm.h:2087
#: elf32-arm.h:2088
#, c-format
msgid ""
"Error: %s passes floats in %s registers, whereas %s passes them in %s "
"registers"
msgstr ""
#: elf32-arm.h:2090 elf32-arm.h:2092
#: elf32-arm.h:2091 elf32-arm.h:2093
msgid "float"
msgstr ""
#: elf32-arm.h:2090 elf32-arm.h:2092
#: elf32-arm.h:2091 elf32-arm.h:2093
msgid "integer"
msgstr ""
#: elf32-arm.h:2095
#: elf32-arm.h:2096
#, c-format
msgid "Error: %s is compiled as position %s code, whereas %s is not"
msgstr ""
#: elf32-arm.h:2098
#: elf32-arm.h:2099
msgid "independent"
msgstr ""
#: elf32-arm.h:2098
#: elf32-arm.h:2099
msgid "dependent"
msgstr ""
#: elf32-arm.h:2104
#: elf32-arm.h:2105
#, c-format
msgid "Warning: %s %s interworking, whereas %s %s"
msgstr ""
#: elf32-arm.h:2107
#: elf32-arm.h:2108
msgid "supports"
msgstr ""
#: elf32-arm.h:2107
#: elf32-arm.h:2108
msgid "does not support"
msgstr ""
#: elf32-arm.h:2109
#: elf32-arm.h:2110
msgid "does not"
msgstr ""
#: elf32-arm.h:2109
#: elf32-arm.h:2110
msgid "does"
msgstr ""
#. Ignore init flag - it may not be set, despite the flags field
#. containing valid data.
#: elf32-arm.h:2136 elf32-m68k.c:430 elf32-mips.c:2631
#: elf32-arm.h:2137 elf32-m68k.c:430 elf32-mips.c:2638
#, c-format
msgid "private flags = %lx:"
msgstr ""
#: elf32-arm.h:2145
#: elf32-arm.h:2146
msgid " [interworking enabled]"
msgstr ""
#: elf32-arm.h:2148
#: elf32-arm.h:2149
msgid " [APCS-26]"
msgstr ""
#: elf32-arm.h:2150
#: elf32-arm.h:2151
msgid " [APCS-32]"
msgstr ""
#: elf32-arm.h:2159
#: elf32-arm.h:2160
msgid " [new ABI]"
msgstr ""
#: elf32-arm.h:2162
#: elf32-arm.h:2163
msgid " [old ABI]"
msgstr ""
#: elf32-arm.h:2165
#: elf32-arm.h:2166
msgid " [software FP]"
msgstr ""
#: elf32-arm.h:2172
#: elf32-arm.h:2173
msgid " [Version1 EABI]"
msgstr ""
#: elf32-arm.h:2175
#: elf32-arm.h:2176
msgid " [sorted symbol table]"
msgstr ""
#: elf32-arm.h:2177
#: elf32-arm.h:2178
msgid " [unsorted symbol table]"
msgstr ""
#: elf32-arm.h:2183
#: elf32-arm.h:2184
msgid " <EABI version unrecognised>"
msgstr ""
#: elf32-arm.h:2190
#: elf32-arm.h:2191
msgid " [relocatable executable]"
msgstr ""
#: elf32-arm.h:2193
#: elf32-arm.h:2194
msgid " [has entry point]"
msgstr ""
#: elf32-arm.h:2198
#: elf32-arm.h:2199
msgid "<Unrecognised flag bits set>"
msgstr ""
#: elf32-avr.c:852 elf32-cris.c:431 elf32-fr30.c:659 elf32-i860.c:1029
#: elf32-avr.c:852 elf32-cris.c:431 elf32-fr30.c:659 elf32-i860.c:1070
#: elf32-v850.c:1685
msgid "internal error: dangerous relocation"
msgstr ""
#: elf32-hppa.c:567
#: elf32-hppa.c:590
#, c-format
msgid "%s(%s+0x%lx): cannot find stub entry %s"
msgstr ""
#: elf32-hppa.c:676
#: elf32-hppa.c:656
#, c-format
msgid "%s: cannot create stub entry %s"
msgstr ""
#: elf32-hppa.c:868
#: elf32-hppa.c:850
#, c-format
msgid "%s(%s+0x%lx): cannot relocate %s, recompile with -ffunction-sections"
msgstr ""
#: elf32-hppa.c:881 elf32-hppa.c:1550
#: elf32-hppa.c:863 elf32-hppa.c:1565
#, c-format
msgid "Could not find relocation section for %s"
msgstr ""
#: elf32-hppa.c:1020 elf32-hppa.c:2987
#: elf32-hppa.c:997 elf32-hppa.c:3234
#, c-format
msgid "%s(%s+0x%lx): cannot reach %s, recompile with -ffunction-sections"
msgstr ""
#: elf32-hppa.c:1342
#: elf32-hppa.c:1319
#, c-format
msgid ""
"%s: relocation %s can not be used when making a shared object; recompile "
"with -fPIC"
msgstr ""
#: elf32-hppa.c:1361
#: elf32-hppa.c:1338
#, c-format
msgid ""
"%s: relocation %s should not be used when making a shared object; recompile "
"with -fPIC"
msgstr ""
#: elf32-hppa.c:2405
#: elf32-hppa.c:2624
#, c-format
msgid "%s: duplicate export stub %s"
msgstr ""
#: elf32-hppa.c:2879
#: elf32-hppa.c:3126
#, c-format
msgid "%s(%s+0x%lx): fixing %s"
msgstr ""
#: elf32-hppa.c:3417
#: elf32-hppa.c:3728
#, c-format
msgid "%s(%s+0x%lx): cannot handle %s for %s"
msgstr ""
@ -836,120 +836,120 @@ msgstr ""
msgid "Linking mips16 objects into %s format is not supported"
msgstr ""
#: elf32-mips.c:2517
#: elf32-mips.c:2524
#, c-format
msgid "%s: linking PIC files with non-PIC files"
msgstr ""
#: elf32-mips.c:2527
#: elf32-mips.c:2534
#, c-format
msgid "%s: linking abicalls files with non-abicalls files"
msgstr ""
#: elf32-mips.c:2557
#: elf32-mips.c:2564
#, c-format
msgid "%s: ISA mismatch (-mips%d) with previous modules (-mips%d)"
msgstr ""
#: elf32-mips.c:2566
#: elf32-mips.c:2573
#, c-format
msgid "%s: ISA mismatch (%d) with previous modules (%d)"
msgstr ""
#: elf32-mips.c:2589
#: elf32-mips.c:2596
#, c-format
msgid "%s: ABI mismatch: linking %s module with previous %s modules"
msgstr ""
#: elf32-mips.c:2603 elf32-ppc.c:1464 elf64-sparc.c:2965
#: elf32-mips.c:2610 elf32-ppc.c:1464 elf64-sparc.c:2965
#, c-format
msgid "%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"
msgstr ""
#: elf32-mips.c:2634
#: elf32-mips.c:2641
msgid " [abi=O32]"
msgstr ""
#: elf32-mips.c:2636
#: elf32-mips.c:2643
msgid " [abi=O64]"
msgstr ""
#: elf32-mips.c:2638
#: elf32-mips.c:2645
msgid " [abi=EABI32]"
msgstr ""
#: elf32-mips.c:2640
#: elf32-mips.c:2647
msgid " [abi=EABI64]"
msgstr ""
#: elf32-mips.c:2642
#: elf32-mips.c:2649
msgid " [abi unknown]"
msgstr ""
#: elf32-mips.c:2644
#: elf32-mips.c:2651
msgid " [abi=N32]"
msgstr ""
#: elf32-mips.c:2646
#: elf32-mips.c:2653
msgid " [abi=64]"
msgstr ""
#: elf32-mips.c:2648
#: elf32-mips.c:2655
msgid " [no abi set]"
msgstr ""
#: elf32-mips.c:2651
#: elf32-mips.c:2658
msgid " [mips1]"
msgstr ""
#: elf32-mips.c:2653
#: elf32-mips.c:2660
msgid " [mips2]"
msgstr ""
#: elf32-mips.c:2655
#: elf32-mips.c:2662
msgid " [mips3]"
msgstr ""
#: elf32-mips.c:2657
#: elf32-mips.c:2664
msgid " [mips4]"
msgstr ""
#: elf32-mips.c:2659
#: elf32-mips.c:2666
msgid " [unknown ISA]"
msgstr ""
#: elf32-mips.c:2662
#: elf32-mips.c:2669
msgid " [32bitmode]"
msgstr ""
#: elf32-mips.c:2664
#: elf32-mips.c:2671
msgid " [not 32bitmode]"
msgstr ""
#: elf32-mips.c:4318
#: elf32-mips.c:4325
msgid "static procedure (no name)"
msgstr ""
#: elf32-mips.c:4930 elf64-alpha.c:4368
#: elf32-mips.c:4937 elf64-alpha.c:4377
#, c-format
msgid "%s: illegal section name `%s'"
msgstr ""
#: elf32-mips.c:5495
#: elf32-mips.c:5502
msgid "not enough GOT space for local GOT entries"
msgstr ""
#: elf32-mips.c:6611
#: elf32-mips.c:6618
#, c-format
msgid "%s: %s+0x%lx: jump to stub routine which is not jal"
msgstr ""
#: elf32-mips.c:7599
#: elf32-mips.c:7606
#, c-format
msgid "Malformed reloc detected for section %s"
msgstr ""
#: elf32-mips.c:7676
#: elf32-mips.c:7683
#, c-format
msgid "%s: CALL16 reloc at 0x%lx not against global symbol"
msgstr ""
@ -992,42 +992,42 @@ msgstr ""
msgid "%s: Relocation %s is not yet supported for symbol %s."
msgstr ""
#: elf32-sh.c:952
#: elf32-sh.c:1084
#, c-format
msgid "%s: 0x%lx: warning: bad R_SH_USES offset"
msgstr ""
#: elf32-sh.c:964
#: elf32-sh.c:1096
#, c-format
msgid "%s: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x"
msgstr ""
#: elf32-sh.c:981
#: elf32-sh.c:1113
#, c-format
msgid "%s: 0x%lx: warning: bad R_SH_USES load offset"
msgstr ""
#: elf32-sh.c:996
#: elf32-sh.c:1128
#, c-format
msgid "%s: 0x%lx: warning: could not find expected reloc"
msgstr ""
#: elf32-sh.c:1033
#: elf32-sh.c:1165
#, c-format
msgid "%s: 0x%lx: warning: symbol in unexpected section"
msgstr ""
#: elf32-sh.c:1155
#: elf32-sh.c:1287
#, c-format
msgid "%s: 0x%lx: warning: could not find expected COUNT reloc"
msgstr ""
#: elf32-sh.c:1164
#: elf32-sh.c:1296
#, c-format
msgid "%s: 0x%lx: warning: bad count"
msgstr ""
#: elf32-sh.c:1557 elf32-sh.c:1944
#: elf32-sh.c:1689 elf32-sh.c:2076
#, c-format
msgid "%s: 0x%lx: fatal: reloc overflow while relaxing"
msgstr ""
@ -1128,7 +1128,7 @@ msgstr ""
msgid "GPDISP relocation did not find ldah and lda instructions"
msgstr ""
#: elf64-alpha.c:3004
#: elf64-alpha.c:3013
#, c-format
msgid "%s: .got subsegment exceeds 64K (size %d)"
msgstr ""
@ -1235,68 +1235,68 @@ msgstr ""
msgid "%s: invalid string offset %u >= %lu for section `%s'"
msgstr ""
#: elf.c:561
#: elf.c:560
msgid ""
"\n"
"Program Header:\n"
msgstr ""
#: elf.c:609
#: elf.c:608
msgid ""
"\n"
"Dynamic Section:\n"
msgstr ""
#: elf.c:738
#: elf.c:737
msgid ""
"\n"
"Version definitions:\n"
msgstr ""
#: elf.c:761
#: elf.c:760
msgid ""
"\n"
"Version References:\n"
msgstr ""
#: elf.c:766
#: elf.c:765
#, c-format
msgid " required from %s:\n"
msgstr ""
#: elf.c:1354
#: elf.c:1353
#, c-format
msgid "%s: invalid link %lu for reloc section %s (index %u)"
msgstr ""
#: elf.c:2115
#: elf.c:2113
#, c-format
msgid ""
"creating section symbol, name = %s, value = 0x%.8lx, index = %d, section = "
"0x%.8lx\n"
msgstr ""
#: elf.c:2718
#: elf.c:2716
#, c-format
msgid "%s: Not enough room for program headers (allocated %u, need %u)"
msgstr ""
#: elf.c:2817
#: elf.c:2815
#, c-format
msgid "%s: Not enough room for program headers, try linking with -N"
msgstr ""
#: elf.c:2943
#: elf.c:2941
#, c-format
msgid "Error: First section in segment (%s) starts at 0x%x"
msgstr ""
#: elf.c:2946
#: elf.c:2944
#, c-format
msgid " whereas segment starts at 0x%x"
msgstr ""
#: elf.c:3219
#: elf.c:3217
#, c-format
msgid "%s: warning: allocated section `%s' not in segment"
msgstr ""
@ -1313,12 +1313,12 @@ msgid ""
"0x%.8lx%s\n"
msgstr ""
#: elf.c:3861
#: elf.c:3863
#, c-format
msgid "%s: warning: Empty loadable segment detected\n"
msgstr ""
#: elf.c:5204
#: elf.c:5207
#, c-format
msgid "%s: unsupported relocation type %s"
msgstr ""
@ -1897,7 +1897,7 @@ msgstr ""
msgid "Partition[%d] length = 0x%.8lx (%ld)\n"
msgstr ""
#: som.c:5331
#: som.c:5368
msgid "som_sizeof_headers unimplemented"
msgstr ""
@ -2217,32 +2217,32 @@ msgstr ""
msgid "warning: attempt to export undefined symbol `%s'"
msgstr ""
#: xcofflink.c:4701
#: xcofflink.c:4719
#, c-format
msgid "TOC overflow: 0x%lx > 0x10000; try -mminimal-toc when compiling"
msgstr ""
#: xcofflink.c:5526 xcofflink.c:5882 xcofflink.c:5919 xcofflink.c:6236
#: xcofflink.c:5544 xcofflink.c:5900 xcofflink.c:5937 xcofflink.c:6254
#, c-format
msgid "%s: loader reloc in unrecognized section `%s'"
msgstr ""
#: xcofflink.c:5548 xcofflink.c:6247
#: xcofflink.c:5566 xcofflink.c:6265
#, c-format
msgid "%s: `%s' in loader reloc but not loader sym"
msgstr ""
#: xcofflink.c:5563
#: xcofflink.c:5581
#, c-format
msgid "%s: loader reloc in read-only section %s"
msgstr ""
#: xcofflink.c:6443
#: xcofflink.c:6461
#, c-format
msgid "%s: unsupported relocation type 0x%02x"
msgstr ""
#: xcofflink.c:6489
#: xcofflink.c:6507
#, c-format
msgid "%s: TOC reloc at 0x%x to symbol `%s' with no TOC entry"
msgstr ""

View File

@ -1,3 +1,10 @@
2000-09-10 Michael Sokolov <msokolov@ivan.Harhan.ORG>
* emultempl/m68kelf.em: New file.
* emulparams/m68kelf.sh (EXTRA_EM_FILE): Use it.
* Makefile.am (em68kelf.c): Add dependency on m68kelf.em.
* Makefile.in: Regenerate.
2000-09-15 Alan Modra <alan@linuxcare.com.au>
* emulparams/hppalinux.sh (DATA_START_SYMBOLS): Provide $global$

View File

@ -615,7 +615,8 @@ em68kcoff.c: $(srcdir)/emulparams/m68kcoff.sh \
$(srcdir)/emultempl/m68kcoff.em $(srcdir)/scripttempl/m68kcoff.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68kcoff "$(tdir_m68kcoff)"
em68kelf.c: $(srcdir)/emulparams/m68kelf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/m68kelf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68kelf "$(tdir_m68kelf)"
em68klinux.c: $(srcdir)/emulparams/m68klinux.sh \
$(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}

View File

@ -1329,7 +1329,8 @@ em68kcoff.c: $(srcdir)/emulparams/m68kcoff.sh \
$(srcdir)/emultempl/m68kcoff.em $(srcdir)/scripttempl/m68kcoff.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68kcoff "$(tdir_m68kcoff)"
em68kelf.c: $(srcdir)/emulparams/m68kelf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/m68kelf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68kelf "$(tdir_m68kelf)"
em68klinux.c: $(srcdir)/emulparams/m68klinux.sh \
$(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}

View File

@ -7,4 +7,5 @@ ARCH=m68k
MACHINE=
NOP=0x4e75
TEMPLATE_NAME=elf32
EXTRA_EM_FILE=m68kelf
GENERATE_SHLIB_SCRIPT=yes

154
ld/emultempl/m68kelf.em Normal file
View File

@ -0,0 +1,154 @@
# This shell script emits a C file. -*- C -*-
# Copyright (C) 2000 Free Software Foundation, Inc.
# Written by Michael Sokolov <msokolov@ivan.Harhan.ORG>, based on armelf.em
#
# This file is part of GLD, the Gnu Linker.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# This file is sourced from elf32.em, and defines extra m68k ELF
# specific routines.
#
cat >>e${EMULATION_NAME}.c <<EOF
static void m68k_elf_after_open PARAMS((void));
static void check_sections PARAMS ((bfd *, asection *, PTR));
static void m68k_elf_after_allocation PARAMS ((void));
/* This function is run after all the input files have been opened.
We create a .emreloc section for each input file with a non zero
.data section. The BFD backend will fill in these sections with
magic numbers which can be used to relocate the data section at run
time. */
static void
m68k_elf_after_open ()
{
bfd *abfd;
/* Call the standard elf routine. */
gld${EMULATION_NAME}_after_open ();
if (! command_line.embedded_relocs
|| link_info.relocateable)
return;
for (abfd = link_info.input_bfds; abfd != NULL; abfd = abfd->link_next)
{
asection *datasec;
/* As first-order business, make sure that each input BFD is ELF. It
better be, as we are directly calling a ELF backend function. */
if (bfd_get_flavour (abfd) != bfd_target_elf_flavour)
einfo ("%F%B: all input objects must be ELF for --embedded-relocs\n");
datasec = bfd_get_section_by_name (abfd, ".data");
/* Note that we assume that the reloc_count field has already
been set up. We could call bfd_get_reloc_upper_bound, but
that returns the size of a memory buffer rather than a reloc
count. We do not want to call bfd_canonicalize_reloc,
because although it would always work it would force us to
read in the relocs into BFD canonical form, which would waste
a significant amount of time and memory. */
if (datasec != NULL && datasec->reloc_count > 0)
{
asection *relsec;
relsec = bfd_make_section (abfd, ".emreloc");
if (relsec == NULL
|| ! bfd_set_section_flags (abfd, relsec,
(SEC_ALLOC
| SEC_LOAD
| SEC_HAS_CONTENTS
| SEC_IN_MEMORY))
|| ! bfd_set_section_alignment (abfd, relsec, 2)
|| ! bfd_set_section_size (abfd, relsec,
datasec->reloc_count * 12))
einfo ("%F%B: can not create .emreloc section: %E\n");
}
/* Double check that all other data sections are empty, as is
required for embedded PIC code. */
bfd_map_over_sections (abfd, check_sections, (PTR) datasec);
}
}
/* Check that of the data sections, only the .data section has
relocs. This is called via bfd_map_over_sections. */
static void
check_sections (abfd, sec, datasec)
bfd *abfd;
asection *sec;
PTR datasec;
{
if ((bfd_get_section_flags (abfd, sec) & SEC_DATA)
&& sec != (asection *) datasec
&& sec->reloc_count != 0)
einfo ("%B%X: section %s has relocs; can not use --embedded-relocs\n",
abfd, bfd_get_section_name (abfd, sec));
}
/* This function is called after the section sizes and offsets have
been set. If we are generating embedded relocs, it calls a special
BFD backend routine to do the work. */
static void
m68k_elf_after_allocation ()
{
bfd *abfd;
/* Call the standard elf routine. */
gld${EMULATION_NAME}_before_allocation ();
if (! command_line.embedded_relocs
|| link_info.relocateable)
return;
for (abfd = link_info.input_bfds; abfd != NULL; abfd = abfd->link_next)
{
asection *datasec, *relsec;
char *errmsg;
datasec = bfd_get_section_by_name (abfd, ".data");
if (datasec == NULL || datasec->reloc_count == 0)
continue;
relsec = bfd_get_section_by_name (abfd, ".emreloc");
ASSERT (relsec != NULL);
if (! bfd_m68k_elf32_create_embedded_relocs (abfd, &link_info,
datasec, relsec,
&errmsg))
{
if (errmsg == NULL)
einfo ("%B%X: can not create runtime reloc information: %E\n",
abfd);
else
einfo ("%X%B: can not create runtime reloc information: %s\n",
abfd, errmsg);
}
}
}
EOF
# We have our own after_open and after_allocation functions, but they call
# the standard routines, so give them a different name.
LDEMUL_AFTER_OPEN=m68k_elf_after_open
LDEMUL_AFTER_ALLOCATION=m68k_elf_after_allocation

View File

@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2000-09-05 14:40-0700\n"
"POT-Creation-Date: 2000-09-15 11:43-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -233,7 +233,7 @@ msgstr ""
msgid "Errors encountered processing file %s for interworking"
msgstr ""
#: emultempl/pe.em:971 ldlang.c:1991 ldlang.c:4364 ldlang.c:4398 ldmain.c:1013
#: emultempl/pe.em:971 ldlang.c:1991 ldlang.c:4364 ldlang.c:4398 ldmain.c:1020
msgid "%P%F: bfd_link_hash_lookup failed: %E\n"
msgstr ""
@ -272,11 +272,11 @@ msgstr ""
msgid "%B%F: could not read symbols; %E\n"
msgstr ""
#: ldcref.c:445 ldmain.c:1081 ldmain.c:1085
#: ldcref.c:445 ldmain.c:1088 ldmain.c:1092
msgid "%B%F: could not read symbols: %E\n"
msgstr ""
#: ldcref.c:517 ldcref.c:524 ldmain.c:1131 ldmain.c:1138
#: ldcref.c:517 ldcref.c:524 ldmain.c:1138 ldmain.c:1145
msgid "%B%F: could not read relocs: %E\n"
msgstr ""
@ -788,92 +788,96 @@ msgstr ""
msgid "%D: first defined here\n"
msgstr ""
#: ldmain.c:894
#: ldmain.c:869
msgid "%P: Disabling relaxation: it will not work with multiple definitions\n"
msgstr ""
#: ldmain.c:901
msgid "%B: warning: definition of `%T' overriding common\n"
msgstr ""
#: ldmain.c:897
#: ldmain.c:904
msgid "%B: warning: common is here\n"
msgstr ""
#: ldmain.c:904
#: ldmain.c:911
msgid "%B: warning: common of `%T' overridden by definition\n"
msgstr ""
#: ldmain.c:907
#: ldmain.c:914
msgid "%B: warning: defined here\n"
msgstr ""
#: ldmain.c:914
#: ldmain.c:921
msgid "%B: warning: common of `%T' overridden by larger common\n"
msgstr ""
#: ldmain.c:917
#: ldmain.c:924
msgid "%B: warning: larger common is here\n"
msgstr ""
#: ldmain.c:921
#: ldmain.c:928
msgid "%B: warning: common of `%T' overriding smaller common\n"
msgstr ""
#: ldmain.c:924
#: ldmain.c:931
msgid "%B: warning: smaller common is here\n"
msgstr ""
#: ldmain.c:928
#: ldmain.c:935
msgid "%B: warning: multiple common of `%T'\n"
msgstr ""
#: ldmain.c:930
#: ldmain.c:937
msgid "%B: warning: previous common is here\n"
msgstr ""
#: ldmain.c:952 ldmain.c:991
#: ldmain.c:959 ldmain.c:998
msgid "%P: warning: global constructor %s used\n"
msgstr ""
#: ldmain.c:1001
#: ldmain.c:1008
msgid "%P%F: BFD backend error: BFD_RELOC_CTOR unsupported\n"
msgstr ""
#: ldmain.c:1188
#: ldmain.c:1195
msgid "%F%P: bfd_hash_table_init failed: %E\n"
msgstr ""
#: ldmain.c:1195
#: ldmain.c:1202
msgid "%F%P: bfd_hash_lookup failed: %E\n"
msgstr ""
#: ldmain.c:1215
#: ldmain.c:1222
msgid "%C: undefined reference to `%T'\n"
msgstr ""
#: ldmain.c:1221
#: ldmain.c:1228
msgid "%D: more undefined references to `%T' follow\n"
msgstr ""
#: ldmain.c:1228
#: ldmain.c:1235
msgid "%B: undefined reference to `%T'\n"
msgstr ""
#: ldmain.c:1234
#: ldmain.c:1241
msgid "%B: more undefined references to `%T' follow\n"
msgstr ""
#: ldmain.c:1255 ldmain.c:1277 ldmain.c:1297
#: ldmain.c:1262 ldmain.c:1284 ldmain.c:1304
msgid "%P%X: generated"
msgstr ""
#: ldmain.c:1258
#: ldmain.c:1265
msgid " relocation truncated to fit: %s %T"
msgstr ""
#: ldmain.c:1280
#: ldmain.c:1287
#, c-format
msgid "dangerous relocation: %s\n"
msgstr ""
#: ldmain.c:1300
#: ldmain.c:1307
msgid " reloc refers to symbol `%T' which is not being output\n"
msgstr ""
@ -1484,7 +1488,7 @@ msgstr ""
msgid "Report bugs to %s\n"
msgstr ""
#: mri.c:343
#: mri.c:323
msgid "%P%F: unknown format type %s\n"
msgstr ""