[ bfd/ChangeLog ]

* elf-bfd.h (local_call_stubs): New member.
	* elfxx-mips.c (FN_STUB_P, CALL_STUB_P, CALL_FP_STUB_P): New macros.
	(mips_elf_calculate_relocation): Handle local mips16 call stubs.
	(mips16_stub_section_p): Rename from mips_elf_stub_section_p, use
	the new stub macros.
	(_bfd_mips_elf_check_relocs): Handle call stubs for code which
	mixes mips16 and mips32 functions. Use mips16_stub_section_p. Mark
	used stubs with SEC_KEEP. Use the new stub macros.

	[ gas/testsuite/ChangeLog ]
	* gas/mips/mips16-intermix.d, gas/mips/mips16-intermix.s: New
	testcase.
	* gas/mips/mips.exp: Run new testcase.

	[ ld/testsuite/ChangeLog ]
	* ld-mips-elf/mips16-intermix-1.s, ld-mips-elf/mips16-intermix-2.s,
	ld-mips-elf/mips16-intermix.d: New testcase.
	* ld-mips-elf/mips-elf.exp (mips16_intermix_test): Run new testcases.
This commit is contained in:
Thiemo Seufer 2006-11-02 15:20:31 +00:00
parent 325a4b61ce
commit b9d58d7191
12 changed files with 5852 additions and 72 deletions

View file

@ -1,3 +1,15 @@
2006-11-01 Thiemo Seufer <ths@mips.com>
David Ung <davidu@mips.com>
* elf-bfd.h (local_call_stubs): New member.
* elfxx-mips.c (FN_STUB_P, CALL_STUB_P, CALL_FP_STUB_P): New macros.
(mips_elf_calculate_relocation): Handle local mips16 call stubs.
(mips16_stub_section_p): Rename from mips_elf_stub_section_p, use
the new stub macros.
(_bfd_mips_elf_check_relocs): Handle call stubs for code which
mixes mips16 and mips32 functions. Use mips16_stub_section_p. Mark
used stubs with SEC_KEEP. Use the new stub macros.
2006-11-01 Alan Modra <amodra@bigpond.net.au>
* elf32-arm.c (bfd_elf32_arm_process_before_allocation): Correct

View file

@ -1353,6 +1353,7 @@ struct elf_obj_tdata
MIPS ELF linker. FIXME: We should figure out some way to only
include this field for a MIPS ELF target. */
asection **local_stubs;
asection **local_call_stubs;
/* Used to determine if PT_GNU_EH_FRAME segment header should be
created. */

View file

@ -493,7 +493,7 @@ static bfd_boolean mips_elf_sort_hash_table_f
(struct mips_elf_link_hash_entry *, void *);
static bfd_vma mips_elf_high
(bfd_vma);
static bfd_boolean mips_elf_stub_section_p
static bfd_boolean mips16_stub_section_p
(bfd *, asection *);
static bfd_boolean mips_elf_create_dynamic_relocation
(bfd *, struct bfd_link_info *, const Elf_Internal_Rela *,
@ -709,6 +709,10 @@ static bfd *reldyn_sorting_bfd;
#define FN_STUB ".mips16.fn."
#define CALL_STUB ".mips16.call."
#define CALL_FP_STUB ".mips16.call.fp."
#define FN_STUB_P(name) CONST_STRNEQ (name, FN_STUB)
#define CALL_STUB_P(name) CONST_STRNEQ (name, CALL_STUB)
#define CALL_FP_STUB_P(name) CONST_STRNEQ (name, CALL_FP_STUB)
/* The format of the first PLT entry in a VxWorks executable. */
static const bfd_vma mips_vxworks_exec_plt0_entry[] = {
@ -4078,9 +4082,10 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
a stub. */
if (r_type != R_MIPS16_26 && !info->relocatable
&& ((h != NULL && h->fn_stub != NULL)
|| (local_p && elf_tdata (input_bfd)->local_stubs != NULL
|| (local_p
&& elf_tdata (input_bfd)->local_stubs != NULL
&& elf_tdata (input_bfd)->local_stubs[r_symndx] != NULL))
&& !mips_elf_stub_section_p (input_bfd, input_section))
&& !mips16_stub_section_p (input_bfd, input_section))
{
/* This is a 32- or 64-bit call to a 16-bit function. We should
have already noticed that we were going to need the
@ -4101,33 +4106,40 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
need to redirect the call to the stub. */
else if (r_type == R_MIPS16_26 && !info->relocatable
&& h != NULL
&& (h->call_stub != NULL || h->call_fp_stub != NULL)
&& ((h->call_stub != NULL || h->call_fp_stub != NULL)
|| (local_p
&& elf_tdata (input_bfd)->local_call_stubs != NULL
&& elf_tdata (input_bfd)->local_call_stubs[r_symndx] != NULL))
&& !target_is_16_bit_code_p)
{
/* If both call_stub and call_fp_stub are defined, we can figure
out which one to use by seeing which one appears in the input
file. */
if (h->call_stub != NULL && h->call_fp_stub != NULL)
{
asection *o;
sec = NULL;
for (o = input_bfd->sections; o != NULL; o = o->next)
{
if (CONST_STRNEQ (bfd_get_section_name (input_bfd, o),
CALL_FP_STUB))
{
sec = h->call_fp_stub;
break;
}
}
if (sec == NULL)
sec = h->call_stub;
}
else if (h->call_stub != NULL)
sec = h->call_stub;
if (local_p)
sec = elf_tdata (input_bfd)->local_call_stubs[r_symndx];
else
sec = h->call_fp_stub;
{
/* If both call_stub and call_fp_stub are defined, we can figure
out which one to use by checking which one appears in the input
file. */
if (h->call_stub != NULL && h->call_fp_stub != NULL)
{
asection *o;
sec = NULL;
for (o = input_bfd->sections; o != NULL; o = o->next)
{
if (CALL_FP_STUB_P (bfd_get_section_name (input_bfd, o)))
{
sec = h->call_fp_stub;
break;
}
}
if (sec == NULL)
sec = h->call_stub;
}
else if (h->call_stub != NULL)
sec = h->call_stub;
else
sec = h->call_fp_stub;
}
BFD_ASSERT (sec->size > 0);
symbol = sec->output_section->vma + sec->output_offset;
@ -4702,13 +4714,11 @@ mips_elf_perform_relocation (struct bfd_link_info *info,
/* Returns TRUE if SECTION is a MIPS16 stub section. */
static bfd_boolean
mips_elf_stub_section_p (bfd *abfd ATTRIBUTE_UNUSED, asection *section)
mips16_stub_section_p (bfd *abfd ATTRIBUTE_UNUSED, asection *section)
{
const char *name = bfd_get_section_name (abfd, section);
return (CONST_STRNEQ (name, FN_STUB)
|| CONST_STRNEQ (name, CALL_STUB)
|| CONST_STRNEQ (name, CALL_FP_STUB));
return FN_STUB_P (name) || CALL_STUB_P (name) || CALL_FP_STUB_P (name);
}
/* Add room for N relocations to the .rel(a).dyn section in ABFD. */
@ -6137,7 +6147,7 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
/* Check for the mips16 stub sections. */
name = bfd_get_section_name (abfd, sec);
if (CONST_STRNEQ (name, FN_STUB))
if (FN_STUB_P (name))
{
unsigned long r_symndx;
@ -6162,9 +6172,7 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
/* We can ignore stub sections when looking for relocs. */
if ((o->flags & SEC_RELOC) == 0
|| o->reloc_count == 0
|| CONST_STRNEQ (bfd_get_section_name (abfd, o), FN_STUB)
|| CONST_STRNEQ (bfd_get_section_name (abfd, o), CALL_STUB)
|| CONST_STRNEQ (bfd_get_section_name (abfd, o), CALL_FP_STUB))
|| mips16_stub_section_p (abfd, o))
continue;
sec_relocs
@ -6216,6 +6224,7 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
elf_tdata (abfd)->local_stubs = n;
}
sec->flags |= SEC_KEEP;
elf_tdata (abfd)->local_stubs[r_symndx] = sec;
/* We don't need to set mips16_stubs_seen in this case.
@ -6236,12 +6245,23 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
/* H is the symbol this stub is for. */
/* If we already have an appropriate stub for this function, we
don't need another one, so we can discard this one. Since
this function is called before the linker maps input sections
to output sections, we can easily discard it by setting the
SEC_EXCLUDE flag. */
if (h->fn_stub != NULL)
{
sec->flags |= SEC_EXCLUDE;
return TRUE;
}
sec->flags |= SEC_KEEP;
h->fn_stub = sec;
mips_elf_hash_table (info)->mips16_stubs_seen = TRUE;
}
}
else if (CONST_STRNEQ (name, CALL_STUB)
|| CONST_STRNEQ (name, CALL_FP_STUB))
else if (CALL_STUB_P (name) || CALL_FP_STUB_P (name))
{
unsigned long r_symndx;
struct mips_elf_link_hash_entry *h;
@ -6255,42 +6275,106 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
if (r_symndx < extsymoff
|| sym_hashes[r_symndx - extsymoff] == NULL)
{
/* This stub was actually built for a static symbol defined
in the same file. We assume that all static symbols in
mips16 code are themselves mips16, so we can simply
discard this stub. Since this function is called before
the linker maps input sections to output sections, we can
easily discard it by setting the SEC_EXCLUDE flag. */
sec->flags |= SEC_EXCLUDE;
return TRUE;
asection *o;
/* This stub is for a local symbol. This stub will only be
needed if there is some relocation (R_MIPS16_26) in this BFD
that refers to this symbol. */
for (o = abfd->sections; o != NULL; o = o->next)
{
Elf_Internal_Rela *sec_relocs;
const Elf_Internal_Rela *r, *rend;
/* We can ignore stub sections when looking for relocs. */
if ((o->flags & SEC_RELOC) == 0
|| o->reloc_count == 0
|| mips16_stub_section_p (abfd, o))
continue;
sec_relocs
= _bfd_elf_link_read_relocs (abfd, o, NULL, NULL,
info->keep_memory);
if (sec_relocs == NULL)
return FALSE;
rend = sec_relocs + o->reloc_count;
for (r = sec_relocs; r < rend; r++)
if (ELF_R_SYM (abfd, r->r_info) == r_symndx
&& ELF_R_TYPE (abfd, r->r_info) == R_MIPS16_26)
break;
if (elf_section_data (o)->relocs != sec_relocs)
free (sec_relocs);
if (r < rend)
break;
}
if (o == NULL)
{
/* There is no non-call reloc for this stub, so we do
not need it. Since this function is called before
the linker maps input sections to output sections, we
can easily discard it by setting the SEC_EXCLUDE
flag. */
sec->flags |= SEC_EXCLUDE;
return TRUE;
}
/* Record this stub in an array of local symbol call_stubs for
this BFD. */
if (elf_tdata (abfd)->local_call_stubs == NULL)
{
unsigned long symcount;
asection **n;
bfd_size_type amt;
if (elf_bad_symtab (abfd))
symcount = NUM_SHDR_ENTRIES (symtab_hdr);
else
symcount = symtab_hdr->sh_info;
amt = symcount * sizeof (asection *);
n = bfd_zalloc (abfd, amt);
if (n == NULL)
return FALSE;
elf_tdata (abfd)->local_call_stubs = n;
}
sec->flags |= SEC_KEEP;
elf_tdata (abfd)->local_call_stubs[r_symndx] = sec;
/* We don't need to set mips16_stubs_seen in this case.
That flag is used to see whether we need to look through
the global symbol table for stubs. We don't need to set
it here, because we just have a local stub. */
}
h = ((struct mips_elf_link_hash_entry *)
sym_hashes[r_symndx - extsymoff]);
/* H is the symbol this stub is for. */
if (CONST_STRNEQ (name, CALL_FP_STUB))
loc = &h->call_fp_stub;
else
loc = &h->call_stub;
/* If we already have an appropriate stub for this function, we
don't need another one, so we can discard this one. Since
this function is called before the linker maps input sections
to output sections, we can easily discard it by setting the
SEC_EXCLUDE flag. We can also discard this section if we
happen to already know that this is a mips16 function; it is
not necessary to check this here, as it is checked later, but
it is slightly faster to check now. */
if (*loc != NULL || h->root.other == STO_MIPS16)
{
sec->flags |= SEC_EXCLUDE;
return TRUE;
}
h = ((struct mips_elf_link_hash_entry *)
sym_hashes[r_symndx - extsymoff]);
/* H is the symbol this stub is for. */
if (CALL_FP_STUB_P (name))
loc = &h->call_fp_stub;
else
loc = &h->call_stub;
/* If we already have an appropriate stub for this function, we
don't need another one, so we can discard this one. Since
this function is called before the linker maps input sections
to output sections, we can easily discard it by setting the
SEC_EXCLUDE flag. */
if (*loc != NULL)
{
sec->flags |= SEC_EXCLUDE;
return TRUE;
}
*loc = sec;
mips_elf_hash_table (info)->mips16_stubs_seen = TRUE;
sec->flags |= SEC_KEEP;
*loc = sec;
mips_elf_hash_table (info)->mips16_stubs_seen = TRUE;
}
}
if (dynobj == NULL)
@ -6655,9 +6739,7 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
References from a stub section do not count. */
if (h != NULL
&& r_type != R_MIPS16_26
&& ! CONST_STRNEQ (bfd_get_section_name (abfd, sec), FN_STUB)
&& ! CONST_STRNEQ (bfd_get_section_name (abfd, sec), CALL_STUB)
&& ! CONST_STRNEQ (bfd_get_section_name (abfd, sec), CALL_FP_STUB))
&& !mips16_stub_section_p (abfd, sec))
{
struct mips_elf_link_hash_entry *mh;

View file

@ -1,3 +1,9 @@
2006-11-01 Thiemo Seufer <ths@mips.com>
* gas/mips/mips16-intermix.d, gas/mips/mips16-intermix.s: New
testcase.
* gas/mips/mips.exp: Run new testcase.
2006-11-01 Mei Ligang <ligang@sunnorth.com.cn>
* gas/score/rD_rA.d: Correct not! and not.c instruction disassembly.

View file

@ -785,6 +785,7 @@ if { [istarget mips*-*-vxworks*] } {
run_dump_test "mips16e-save"
run_dump_test "mips16e-64"
run_list_test "mips16e-64" "-march=mips32 -32"
run_dump_test "mips16-intermix"
}
run_dump_test "vxworks1"
run_dump_test "vxworks1-xgot"

View file

@ -0,0 +1,164 @@
#objdump: -t
#as: -mips32r2
#name: MIPS16 intermix
.*: +file format .*mips.*
SYMBOL TABLE:
#...
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ m32_static_l
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ 0xf0 m16_static_l
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ m32_static1_l
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ 0xf0 m16_static1_l
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ m32_static32_l
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ 0xf0 m16_static32_l
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ m32_static16_l
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ 0xf0 m16_static16_l
0+[0-9a-f]+ l d .mips16.fn.m16_d 0+[0-9a-f]+ .mips16.fn.m16_d
0+[0-9a-f]+ l F .mips16.fn.m16_d 0+[0-9a-f]+ __fn_stub_m16_d
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ m32_static_d
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ 0xf0 m16_static_d
0+[0-9a-f]+ l d .mips16.fn.m16_static_d 0+[0-9a-f]+ .mips16.fn.m16_static_d
0+[0-9a-f]+ l F .mips16.fn.m16_static_d 0+[0-9a-f]+ __fn_stub_m16_static_d
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ m32_static1_d
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ 0xf0 m16_static1_d
0+[0-9a-f]+ l d .mips16.fn.m16_static1_d 0+[0-9a-f]+ .mips16.fn.m16_static1_d
0+[0-9a-f]+ l F .mips16.fn.m16_static1_d 0+[0-9a-f]+ __fn_stub_m16_static1_d
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ m32_static32_d
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ 0xf0 m16_static32_d
0+[0-9a-f]+ l d .mips16.fn.m16_static32_d 0+[0-9a-f]+ .mips16.fn.m16_static32_d
0+[0-9a-f]+ l F .mips16.fn.m16_static32_d 0+[0-9a-f]+ __fn_stub_m16_static32_d
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ m32_static16_d
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ 0xf0 m16_static16_d
0+[0-9a-f]+ l d .mips16.fn.m16_static16_d 0+[0-9a-f]+ .mips16.fn.m16_static16_d
0+[0-9a-f]+ l F .mips16.fn.m16_static16_d 0+[0-9a-f]+ __fn_stub_m16_static16_d
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ m32_static_ld
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ 0xf0 m16_static_ld
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ m32_static1_ld
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ 0xf0 m16_static1_ld
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ m32_static32_ld
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ 0xf0 m16_static32_ld
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ m32_static16_ld
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ 0xf0 m16_static16_ld
0+[0-9a-f]+ l d .mips16.fn.m16_dl 0+[0-9a-f]+ .mips16.fn.m16_dl
0+[0-9a-f]+ l F .mips16.fn.m16_dl 0+[0-9a-f]+ __fn_stub_m16_dl
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ m32_static_dl
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ 0xf0 m16_static_dl
0+[0-9a-f]+ l d .mips16.fn.m16_static_dl 0+[0-9a-f]+ .mips16.fn.m16_static_dl
0+[0-9a-f]+ l F .mips16.fn.m16_static_dl 0+[0-9a-f]+ __fn_stub_m16_static_dl
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ m32_static1_dl
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ 0xf0 m16_static1_dl
0+[0-9a-f]+ l d .mips16.fn.m16_static1_dl 0+[0-9a-f]+ .mips16.fn.m16_static1_dl
0+[0-9a-f]+ l F .mips16.fn.m16_static1_dl 0+[0-9a-f]+ __fn_stub_m16_static1_dl
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ m32_static32_dl
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ 0xf0 m16_static32_dl
0+[0-9a-f]+ l d .mips16.fn.m16_static32_dl 0+[0-9a-f]+ .mips16.fn.m16_static32_dl
0+[0-9a-f]+ l F .mips16.fn.m16_static32_dl 0+[0-9a-f]+ __fn_stub_m16_static32_dl
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ m32_static16_dl
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ 0xf0 m16_static16_dl
0+[0-9a-f]+ l d .mips16.fn.m16_static16_dl 0+[0-9a-f]+ .mips16.fn.m16_static16_dl
0+[0-9a-f]+ l F .mips16.fn.m16_static16_dl 0+[0-9a-f]+ __fn_stub_m16_static16_dl
0+[0-9a-f]+ l d .mips16.fn.m16_dlld 0+[0-9a-f]+ .mips16.fn.m16_dlld
0+[0-9a-f]+ l F .mips16.fn.m16_dlld 0+[0-9a-f]+ __fn_stub_m16_dlld
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ m32_static_dlld
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ 0xf0 m16_static_dlld
0+[0-9a-f]+ l d .mips16.fn.m16_static_dlld 0+[0-9a-f]+ .mips16.fn.m16_static_dlld
0+[0-9a-f]+ l F .mips16.fn.m16_static_dlld 0+[0-9a-f]+ __fn_stub_m16_static_dlld
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ m32_static1_dlld
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ 0xf0 m16_static1_dlld
0+[0-9a-f]+ l d .mips16.fn.m16_static1_dlld 0+[0-9a-f]+ .mips16.fn.m16_static1_dlld
0+[0-9a-f]+ l F .mips16.fn.m16_static1_dlld 0+[0-9a-f]+ __fn_stub_m16_static1_dlld
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ m32_static32_dlld
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ 0xf0 m16_static32_dlld
0+[0-9a-f]+ l d .mips16.fn.m16_static32_dlld 0+[0-9a-f]+ .mips16.fn.m16_static32_dlld
0+[0-9a-f]+ l F .mips16.fn.m16_static32_dlld 0+[0-9a-f]+ __fn_stub_m16_static32_dlld
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ m32_static16_dlld
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ 0xf0 m16_static16_dlld
0+[0-9a-f]+ l d .mips16.fn.m16_static16_dlld 0+[0-9a-f]+ .mips16.fn.m16_static16_dlld
0+[0-9a-f]+ l F .mips16.fn.m16_static16_dlld 0+[0-9a-f]+ __fn_stub_m16_static16_dlld
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ m32_static_d_l
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ 0xf0 m16_static_d_l
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ m32_static1_d_l
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ 0xf0 m16_static1_d_l
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ m32_static32_d_l
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ 0xf0 m16_static32_d_l
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ m32_static16_d_l
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ 0xf0 m16_static16_d_l
0+[0-9a-f]+ l d .mips16.fn.m16_d_d 0+[0-9a-f]+ .mips16.fn.m16_d_d
0+[0-9a-f]+ l F .mips16.fn.m16_d_d 0+[0-9a-f]+ __fn_stub_m16_d_d
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ m32_static_d_d
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ 0xf0 m16_static_d_d
0+[0-9a-f]+ l d .mips16.fn.m16_static_d_d 0+[0-9a-f]+ .mips16.fn.m16_static_d_d
0+[0-9a-f]+ l F .mips16.fn.m16_static_d_d 0+[0-9a-f]+ __fn_stub_m16_static_d_d
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ m32_static1_d_d
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ 0xf0 m16_static1_d_d
0+[0-9a-f]+ l d .mips16.fn.m16_static1_d_d 0+[0-9a-f]+ .mips16.fn.m16_static1_d_d
0+[0-9a-f]+ l F .mips16.fn.m16_static1_d_d 0+[0-9a-f]+ __fn_stub_m16_static1_d_d
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ m32_static32_d_d
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ 0xf0 m16_static32_d_d
0+[0-9a-f]+ l d .mips16.fn.m16_static32_d_d 0+[0-9a-f]+ .mips16.fn.m16_static32_d_d
0+[0-9a-f]+ l F .mips16.fn.m16_static32_d_d 0+[0-9a-f]+ __fn_stub_m16_static32_d_d
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ m32_static16_d_d
0+[0-9a-f]+ l F .text 0+[0-9a-f]+ 0xf0 m16_static16_d_d
0+[0-9a-f]+ l d .mips16.fn.m16_static16_d_d 0+[0-9a-f]+ .mips16.fn.m16_static16_d_d
0+[0-9a-f]+ l F .mips16.fn.m16_static16_d_d 0+[0-9a-f]+ __fn_stub_m16_static16_d_d
0+[0-9a-f]+ l d .mips16.call.m32_static1_d 0+[0-9a-f]+ .mips16.call.m32_static1_d
0+[0-9a-f]+ l F .mips16.call.m32_static1_d 0+[0-9a-f]+ __call_stub_m32_static1_d
0+[0-9a-f]+ l d .mips16.call.m16_static1_d 0+[0-9a-f]+ .mips16.call.m16_static1_d
0+[0-9a-f]+ l F .mips16.call.m16_static1_d 0+[0-9a-f]+ __call_stub_m16_static1_d
0+[0-9a-f]+ l d .mips16.call.m32_static1_dl 0+[0-9a-f]+ .mips16.call.m32_static1_dl
0+[0-9a-f]+ l F .mips16.call.m32_static1_dl 0+[0-9a-f]+ __call_stub_m32_static1_dl
0+[0-9a-f]+ l d .mips16.call.m16_static1_dl 0+[0-9a-f]+ .mips16.call.m16_static1_dl
0+[0-9a-f]+ l F .mips16.call.m16_static1_dl 0+[0-9a-f]+ __call_stub_m16_static1_dl
0+[0-9a-f]+ l d .mips16.call.m32_static1_dlld 0+[0-9a-f]+ .mips16.call.m32_static1_dlld
0+[0-9a-f]+ l F .mips16.call.m32_static1_dlld 0+[0-9a-f]+ __call_stub_m32_static1_dlld
0+[0-9a-f]+ l d .mips16.call.m16_static1_dlld 0+[0-9a-f]+ .mips16.call.m16_static1_dlld
0+[0-9a-f]+ l F .mips16.call.m16_static1_dlld 0+[0-9a-f]+ __call_stub_m16_static1_dlld
0+[0-9a-f]+ l d .mips16.call.fp.m32_static1_d_l 0+[0-9a-f]+ .mips16.call.fp.m32_static1_d_l
0+[0-9a-f]+ l F .mips16.call.fp.m32_static1_d_l 0+[0-9a-f]+ __call_stub_fp_m32_static1_d_l
0+[0-9a-f]+ l d .mips16.call.fp.m16_static1_d_l 0+[0-9a-f]+ .mips16.call.fp.m16_static1_d_l
0+[0-9a-f]+ l F .mips16.call.fp.m16_static1_d_l 0+[0-9a-f]+ __call_stub_fp_m16_static1_d_l
0+[0-9a-f]+ l d .mips16.call.fp.m32_static1_d_d 0+[0-9a-f]+ .mips16.call.fp.m32_static1_d_d
0+[0-9a-f]+ l F .mips16.call.fp.m32_static1_d_d 0+[0-9a-f]+ __call_stub_fp_m32_static1_d_d
0+[0-9a-f]+ l d .mips16.call.fp.m16_static1_d_d 0+[0-9a-f]+ .mips16.call.fp.m16_static1_d_d
0+[0-9a-f]+ l F .mips16.call.fp.m16_static1_d_d 0+[0-9a-f]+ __call_stub_fp_m16_static1_d_d
0+[0-9a-f]+ l d .mips16.call.m32_static16_d 0+[0-9a-f]+ .mips16.call.m32_static16_d
0+[0-9a-f]+ l F .mips16.call.m32_static16_d 0+[0-9a-f]+ __call_stub_m32_static16_d
0+[0-9a-f]+ l d .mips16.call.m16_static16_d 0+[0-9a-f]+ .mips16.call.m16_static16_d
0+[0-9a-f]+ l F .mips16.call.m16_static16_d 0+[0-9a-f]+ __call_stub_m16_static16_d
0+[0-9a-f]+ l d .mips16.call.m32_static16_dl 0+[0-9a-f]+ .mips16.call.m32_static16_dl
0+[0-9a-f]+ l F .mips16.call.m32_static16_dl 0+[0-9a-f]+ __call_stub_m32_static16_dl
0+[0-9a-f]+ l d .mips16.call.m16_static16_dl 0+[0-9a-f]+ .mips16.call.m16_static16_dl
0+[0-9a-f]+ l F .mips16.call.m16_static16_dl 0+[0-9a-f]+ __call_stub_m16_static16_dl
0+[0-9a-f]+ l d .mips16.call.m32_static16_dlld 0+[0-9a-f]+ .mips16.call.m32_static16_dlld
0+[0-9a-f]+ l F .mips16.call.m32_static16_dlld 0+[0-9a-f]+ __call_stub_m32_static16_dlld
0+[0-9a-f]+ l d .mips16.call.m16_static16_dlld 0+[0-9a-f]+ .mips16.call.m16_static16_dlld
0+[0-9a-f]+ l F .mips16.call.m16_static16_dlld 0+[0-9a-f]+ __call_stub_m16_static16_dlld
0+[0-9a-f]+ l d .mips16.call.fp.m32_static16_d_l 0+[0-9a-f]+ .mips16.call.fp.m32_static16_d_l
0+[0-9a-f]+ l F .mips16.call.fp.m32_static16_d_l 0+[0-9a-f]+ __call_stub_fp_m32_static16_d_l
0+[0-9a-f]+ l d .mips16.call.fp.m16_static16_d_l 0+[0-9a-f]+ .mips16.call.fp.m16_static16_d_l
0+[0-9a-f]+ l F .mips16.call.fp.m16_static16_d_l 0+[0-9a-f]+ __call_stub_fp_m16_static16_d_l
0+[0-9a-f]+ l d .mips16.call.fp.m32_static16_d_d 0+[0-9a-f]+ .mips16.call.fp.m32_static16_d_d
0+[0-9a-f]+ l F .mips16.call.fp.m32_static16_d_d 0+[0-9a-f]+ __call_stub_fp_m32_static16_d_d
0+[0-9a-f]+ l d .mips16.call.fp.m16_static16_d_d 0+[0-9a-f]+ .mips16.call.fp.m16_static16_d_d
0+[0-9a-f]+ l F .mips16.call.fp.m16_static16_d_d 0+[0-9a-f]+ __call_stub_fp_m16_static16_d_d
#...
0+[0-9a-f]+ g F .text 0+[0-9a-f]+ m32_l
0+[0-9a-f]+ g F .text 0+[0-9a-f]+ 0xf0 m16_l
0+[0-9a-f]+ g F .text 0+[0-9a-f]+ m32_d
0+[0-9a-f]+ g F .text 0+[0-9a-f]+ 0xf0 m16_d
#...
0+[0-9a-f]+ g F .text 0+[0-9a-f]+ m32_ld
0+[0-9a-f]+ g F .text 0+[0-9a-f]+ 0xf0 m16_ld
0+[0-9a-f]+ g F .text 0+[0-9a-f]+ m32_dl
0+[0-9a-f]+ g F .text 0+[0-9a-f]+ 0xf0 m16_dl
0+[0-9a-f]+ g F .text 0+[0-9a-f]+ m32_dlld
0+[0-9a-f]+ g F .text 0+[0-9a-f]+ 0xf0 m16_dlld
0+[0-9a-f]+ g F .text 0+[0-9a-f]+ m32_d_l
0+[0-9a-f]+ g F .text 0+[0-9a-f]+ 0xf0 m16_d_l
#...
0+[0-9a-f]+ g F .text 0+[0-9a-f]+ m32_d_d
0+[0-9a-f]+ g F .text 0+[0-9a-f]+ 0xf0 m16_d_d
0+[0-9a-f]+ g F .text 0+[0-9a-f]+ f32
0+[0-9a-f]+ g F .text 0+[0-9a-f]+ 0xf0 f16
#pass

File diff suppressed because it is too large Load diff

View file

@ -1,3 +1,9 @@
2006-11-01 Thiemo Seufer <ths@mips.com>
* ld-mips-elf/mips16-intermix-1.s, ld-mips-elf/mips16-intermix-2.s,
ld-mips-elf/mips16-intermix.d: New testcase.
* ld-mips-elf/mips-elf.exp (mips16_intermix_test): Run new testcases.
2006-10-29 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* ld-sh/sh64/abi32.xd, ld-sh/sh64/abi64.xd, ld-sh/sh64/cmpct1.xd,

View file

@ -259,3 +259,13 @@ set mips16_call_global_test {
}
run_ld_link_tests $mips16_call_global_test
set mips16_intermix_test {
{"Intermixing mips32 and mips16 functions"
""
"-mips32r2" {mips16-intermix-1.s mips16-intermix-2.s}
{{objdump -t mips16-intermix.d}}
"mips16-intermix"}
}
run_ld_link_tests $mips16_intermix_test

View file

@ -0,0 +1,104 @@
.text
.align 2
.globl __start
.set nomips16
.ent __start
__start:
.frame $sp,56,$31 # vars= 0, regs= 3/2, args= 24, gp= 0
.mask 0x80030000,-24
.fmask 0x00f00000,-8
.set noreorder
.set nomacro
addiu $sp,$sp,-56
sw $31,32($sp)
sw $17,28($sp)
sw $16,24($sp)
sdc1 $f22,48($sp)
sdc1 $f20,40($sp)
jal m32_l
move $4,$17
move $4,$17
jal m16_l
move $16,$2
addu $16,$16,$2
jal m32_d
mov.d $f12,$f22
addu $16,$16,$2
jal m16_d
mov.d $f12,$f22
move $4,$17
mfc1 $7,$f22
mfc1 $6,$f23
jal m32_ld
addu $16,$16,$2
move $4,$17
mfc1 $7,$f22
mfc1 $6,$f23
jal m16_ld
addu $16,$16,$2
move $6,$17
mov.d $f12,$f22
jal m32_dl
addu $16,$16,$2
move $6,$17
mov.d $f12,$f22
jal m16_dl
addu $16,$16,$2
move $6,$17
move $7,$17
sdc1 $f22,16($sp)
mov.d $f12,$f22
jal m32_dlld
addu $16,$16,$2
move $6,$17
move $7,$17
mov.d $f12,$f22
sdc1 $f22,16($sp)
jal m16_dlld
addu $16,$16,$2
move $4,$17
jal m32_d_l
addu $16,$16,$2
move $4,$17
jal m16_d_l
mov.d $f20,$f0
move $4,$17
mfc1 $7,$f22
mfc1 $6,$f23
jal f32
add.d $f20,$f20,$f0
move $4,$17
add.d $f20,$f20,$f0
mfc1 $7,$f22
jal f16
mfc1 $6,$f23
add.d $f20,$f20,$f0
lw $31,32($sp)
trunc.w.d $f0,$f20
lw $17,28($sp)
mfc1 $3,$f0
addu $2,$3,$16
lw $16,24($sp)
ldc1 $f22,48($sp)
ldc1 $f20,40($sp)
j $31
addiu $sp,$sp,56
.set macro
.set reorder
.end __start

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,132 @@
.*: +file format elf.*mips
SYMBOL TABLE:
#...
.* l F .text 0+[0-9a-f]+ m32_static_l
.* l F .text 0+[0-9a-f]+ 0xf0 m16_static_l
.* l F .text 0+[0-9a-f]+ m32_static1_l
.* l F .text 0+[0-9a-f]+ 0xf0 m16_static1_l
.* l F .text 0+[0-9a-f]+ m32_static32_l
.* l F .text 0+[0-9a-f]+ 0xf0 m16_static32_l
.* l F .text 0+[0-9a-f]+ m32_static16_l
.* l F .text 0+[0-9a-f]+ 0xf0 m16_static16_l
.* l F .text 0+[0-9a-f]+ __fn_stub_m16_d
.* l F .text 0+[0-9a-f]+ m32_static_d
.* l F .text 0+[0-9a-f]+ 0xf0 m16_static_d
.* l F .text 0+[0-9a-f]+ __fn_stub_m16_static_d
.* l F .text 0+[0-9a-f]+ m32_static1_d
.* l F .text 0+[0-9a-f]+ 0xf0 m16_static1_d
.* l F .text 0+[0-9a-f]+ __fn_stub_m16_static1_d
.* l F .text 0+[0-9a-f]+ m32_static32_d
.* l F .text 0+[0-9a-f]+ 0xf0 m16_static32_d
.* l F .text 0+[0-9a-f]+ __fn_stub_m16_static32_d
.* l F .text 0+[0-9a-f]+ m32_static16_d
.* l F .text 0+[0-9a-f]+ 0xf0 m16_static16_d
.* l F .text 0+[0-9a-f]+ __fn_stub_m16_static16_d
.* l F .text 0+[0-9a-f]+ m32_static_ld
.* l F .text 0+[0-9a-f]+ 0xf0 m16_static_ld
.* l F .text 0+[0-9a-f]+ m32_static1_ld
.* l F .text 0+[0-9a-f]+ 0xf0 m16_static1_ld
.* l F .text 0+[0-9a-f]+ m32_static32_ld
.* l F .text 0+[0-9a-f]+ 0xf0 m16_static32_ld
.* l F .text 0+[0-9a-f]+ m32_static16_ld
.* l F .text 0+[0-9a-f]+ 0xf0 m16_static16_ld
.* l F .text 0+[0-9a-f]+ __fn_stub_m16_dl
.* l F .text 0+[0-9a-f]+ m32_static_dl
.* l F .text 0+[0-9a-f]+ 0xf0 m16_static_dl
.* l F .text 0+[0-9a-f]+ __fn_stub_m16_static_dl
.* l F .text 0+[0-9a-f]+ m32_static1_dl
.* l F .text 0+[0-9a-f]+ 0xf0 m16_static1_dl
.* l F .text 0+[0-9a-f]+ __fn_stub_m16_static1_dl
.* l F .text 0+[0-9a-f]+ m32_static32_dl
.* l F .text 0+[0-9a-f]+ 0xf0 m16_static32_dl
.* l F .text 0+[0-9a-f]+ __fn_stub_m16_static32_dl
.* l F .text 0+[0-9a-f]+ m32_static16_dl
.* l F .text 0+[0-9a-f]+ 0xf0 m16_static16_dl
.* l F .text 0+[0-9a-f]+ __fn_stub_m16_static16_dl
.* l F .text 0+[0-9a-f]+ __fn_stub_m16_dlld
.* l F .text 0+[0-9a-f]+ m32_static_dlld
.* l F .text 0+[0-9a-f]+ 0xf0 m16_static_dlld
.* l F .text 0+[0-9a-f]+ __fn_stub_m16_static_dlld
.* l F .text 0+[0-9a-f]+ m32_static1_dlld
.* l F .text 0+[0-9a-f]+ 0xf0 m16_static1_dlld
.* l F .text 0+[0-9a-f]+ __fn_stub_m16_static1_dlld
.* l F .text 0+[0-9a-f]+ m32_static32_dlld
.* l F .text 0+[0-9a-f]+ 0xf0 m16_static32_dlld
.* l F .text 0+[0-9a-f]+ __fn_stub_m16_static32_dlld
.* l F .text 0+[0-9a-f]+ m32_static16_dlld
.* l F .text 0+[0-9a-f]+ 0xf0 m16_static16_dlld
.* l F .text 0+[0-9a-f]+ __fn_stub_m16_static16_dlld
.* l F .text 0+[0-9a-f]+ m32_static_d_l
.* l F .text 0+[0-9a-f]+ 0xf0 m16_static_d_l
.* l F .text 0+[0-9a-f]+ m32_static1_d_l
.* l F .text 0+[0-9a-f]+ 0xf0 m16_static1_d_l
.* l F .text 0+[0-9a-f]+ m32_static32_d_l
.* l F .text 0+[0-9a-f]+ 0xf0 m16_static32_d_l
.* l F .text 0+[0-9a-f]+ m32_static16_d_l
.* l F .text 0+[0-9a-f]+ 0xf0 m16_static16_d_l
.* l F .text 0+[0-9a-f]+ __fn_stub_m16_d_d
.* l F .text 0+[0-9a-f]+ m32_static_d_d
.* l F .text 0+[0-9a-f]+ 0xf0 m16_static_d_d
.* l F .text 0+[0-9a-f]+ __fn_stub_m16_static_d_d
.* l F .text 0+[0-9a-f]+ m32_static1_d_d
.* l F .text 0+[0-9a-f]+ 0xf0 m16_static1_d_d
.* l F .text 0+[0-9a-f]+ __fn_stub_m16_static1_d_d
.* l F .text 0+[0-9a-f]+ m32_static32_d_d
.* l F .text 0+[0-9a-f]+ 0xf0 m16_static32_d_d
.* l F .text 0+[0-9a-f]+ __fn_stub_m16_static32_d_d
.* l F .text 0+[0-9a-f]+ m32_static16_d_d
.* l F .text 0+[0-9a-f]+ 0xf0 m16_static16_d_d
.* l F .text 0+[0-9a-f]+ __fn_stub_m16_static16_d_d
#...
.* l F .text 0+[0-9a-f]+ __call_stub_m32_static1_d
.* l F .text 0+[0-9a-f]+ __call_stub_m16_static1_d
.* l F .text 0+[0-9a-f]+ __call_stub_m32_static1_dl
.* l F .text 0+[0-9a-f]+ __call_stub_m16_static1_dl
.* l F .text 0+[0-9a-f]+ __call_stub_m32_static1_dlld
.* l F .text 0+[0-9a-f]+ __call_stub_m16_static1_dlld
.* l F .text 0+[0-9a-f]+ __call_stub_fp_m32_static1_d_l
.* l F .text 0+[0-9a-f]+ __call_stub_fp_m16_static1_d_l
.* l F .text 0+[0-9a-f]+ __call_stub_fp_m32_static1_d_d
.* l F .text 0+[0-9a-f]+ __call_stub_fp_m16_static1_d_d
.* l F .text 0+[0-9a-f]+ __call_stub_m32_static16_d
.* l F .text 0+[0-9a-f]+ __call_stub_m16_static16_d
.* l F .text 0+[0-9a-f]+ __call_stub_m32_static16_dl
.* l F .text 0+[0-9a-f]+ __call_stub_m16_static16_dl
.* l F .text 0+[0-9a-f]+ __call_stub_m32_static16_dlld
.* l F .text 0+[0-9a-f]+ __call_stub_m16_static16_dlld
.* l F .text 0+[0-9a-f]+ __call_stub_fp_m32_static16_d_l
.* l F .text 0+[0-9a-f]+ __call_stub_fp_m16_static16_d_l
.* l F .text 0+[0-9a-f]+ __call_stub_fp_m32_static16_d_d
.* l F .text 0+[0-9a-f]+ __call_stub_fp_m16_static16_d_d
#...
.* g F .text 0+[0-9a-f]+ m32_ld
#...
.* g F .text 0+[0-9a-f]+ m32_d_l
.* g F .text 0+[0-9a-f]+ 0xf0 m16_d_d
.* g F .text 0+[0-9a-f]+ 0xf0 m16_d
#...
.* g F .text 0+[0-9a-f]+ 0xf0 f16
#...
.* g F .text 0+[0-9a-f]+ m32_d
#...
.* g F .text 0+[0-9a-f]+ 0xf0 m16_dl
#...
.* g F .text 0+[0-9a-f]+ f32
#...
.* g F .text 0+[0-9a-f]+ 0xf0 m16_l
#...
.* g F .text 0+[0-9a-f]+ 0xf0 m16_ld
#...
.* g F .text 0+[0-9a-f]+ 0xf0 m16_dlld
.* g F .text 0+[0-9a-f]+ m32_d_d
#...
.* g F .text 0+[0-9a-f]+ m32_dl
#...
.* g F .text 0+[0-9a-f]+ m32_dlld
#...
.* g F .text 0+[0-9a-f]+ 0xf0 m16_d_l
#...
.* g F .text 0+[0-9a-f]+ m32_l
#pass