2003-05-07 Eric Christopher <echristo@redhat.com>

Alexandre Oliva   <aoliva@redhat.com>

	* elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Adjust
	pic tests, change to warning.
	(_bfd_mips_elf_final_link): Remove EF_MIPS_CPIC flag setting.

2003-05-07  Eric Christopher  <echristo@redhat.com>

        * config/tc-mips.c (mips_abicalls): New variable.
        (md_parse_option): Use.
        (s_option): Ditto.
        (s_abicalls): Ditto.
        (mips_elf_final_processing): Set EF_MIPS_PIC and
        EF_MIPS_CPIC dependent on above.
This commit is contained in:
Eric Christopher
2003-05-21 21:53:33 +00:00
parent 44482353b7
commit 143d77c5e9
4 changed files with 75 additions and 61 deletions

View File

@ -1,3 +1,10 @@
2003-05-07 Eric Christopher <echristo@redhat.com>
Alexandre Oliva <aoliva@redhat.com>
* elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Adjust
pic tests, change to warning.
(_bfd_mips_elf_final_link): Remove EF_MIPS_CPIC flag setting.
2003-05-21 Marcus Comstedt <marcus@mc.pp.se>
* config.bfd: Check for a target triplet of shl-...-netbsdelf as

View File

@ -163,8 +163,7 @@ struct mips_elf_hash_sort_data
long min_got_dynindx;
/* The greatest dynamic symbol table index corresponding to a symbol
with a GOT entry that is not referenced (e.g., a dynamic symbol
with dynamic relocations pointing to it from non-primary
GOTs). */
with dynamic relocations pointing to it from non-primary GOTs). */
long max_unref_got_dynindx;
/* The greatest dynamic symbol table index not corresponding to a
symbol without a GOT entry. */
@ -246,8 +245,7 @@ struct mips_elf_link_hash_table
struct extsym_info
{
bfd *abfd;
struct bfd_link_info *info;
bfd *abfd; struct bfd_link_info *info;
struct ecoff_debug_info *debug;
const struct ecoff_debug_swap *swap;
bfd_boolean failed;
@ -8380,17 +8378,6 @@ _bfd_mips_elf_final_link (abfd, info)
scRData, scSData, scSBss, scBss
};
/* If all the things we linked together were PIC, but we're
producing an executable (rather than a shared object), then the
resulting file is CPIC (i.e., it calls PIC code.) */
if (!info->shared
&& !info->relocateable
&& elf_elfheader (abfd)->e_flags & EF_MIPS_PIC)
{
elf_elfheader (abfd)->e_flags &= ~EF_MIPS_PIC;
elf_elfheader (abfd)->e_flags |= EF_MIPS_CPIC;
}
/* We'd carefully arranged the dynamic symbol indices, and then the
generic size_dynamic_sections renumbered them out from under us.
Rather than trying somehow to prevent the renumbering, just do
@ -9250,25 +9237,22 @@ _bfd_mips_elf_merge_private_bfd_data (ibfd, obfd)
ok = TRUE;
if ((new_flags & EF_MIPS_PIC) != (old_flags & EF_MIPS_PIC))
if (((new_flags & (EF_MIPS_PIC | EF_MIPS_CPIC)) != 0)
!= ((old_flags & (EF_MIPS_PIC | EF_MIPS_CPIC)) != 0))
{
new_flags &= ~EF_MIPS_PIC;
old_flags &= ~EF_MIPS_PIC;
(*_bfd_error_handler)
(_("%s: linking PIC files with non-PIC files"),
(_("%s: warning: linking PIC files with non-PIC files"),
bfd_archive_filename (ibfd));
ok = FALSE;
ok = TRUE;
}
if ((new_flags & EF_MIPS_CPIC) != (old_flags & EF_MIPS_CPIC))
{
new_flags &= ~EF_MIPS_CPIC;
old_flags &= ~EF_MIPS_CPIC;
(*_bfd_error_handler)
(_("%s: linking abicalls files with non-abicalls files"),
bfd_archive_filename (ibfd));
ok = FALSE;
}
if (new_flags & (EF_MIPS_PIC | EF_MIPS_CPIC))
elf_elfheader (obfd)->e_flags |= EF_MIPS_CPIC;
if (! (new_flags & EF_MIPS_PIC))
elf_elfheader (obfd)->e_flags &= ~EF_MIPS_PIC;
new_flags &= ~ (EF_MIPS_PIC | EF_MIPS_CPIC);
old_flags &= ~ (EF_MIPS_PIC | EF_MIPS_CPIC);
/* Compare the ISAs. */
if (mips_32bit_flags_p (old_flags) != mips_32bit_flags_p (new_flags))

View File

@ -1,3 +1,12 @@
2003-05-07 Eric Christopher <echristo@redhat.com>
* config/tc-mips.c (mips_abicalls): New variable.
(md_parse_option): Use.
(s_option): Ditto.
(s_abicalls): Ditto.
(mips_elf_final_processing): Set EF_MIPS_PIC and
EF_MIPS_CPIC dependent on above.
2003-05-21 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* tc-hppa.c (hppa_symbol_chars): Remove `,' and `!'.

View File

@ -131,6 +131,9 @@ enum mips_abi_level
/* MIPS ABI we are using for this output file. */
static enum mips_abi_level mips_abi = NO_ABI;
/* Whether or not we have code that can call pic code. */
int mips_abicalls = FALSE;
/* This is the set of options which may be modified by the .set
pseudo-op. We use a struct so that .set push and .set pop are more
reliable. */
@ -11038,6 +11041,7 @@ md_parse_option (c, arg)
return 0;
}
mips_pic = SVR4_PIC;
mips_abicalls = TRUE;
if (g_switch_seen && g_switch_value != 0)
{
as_bad (_("-G may not be used with SVR4 PIC code"));
@ -11053,6 +11057,7 @@ md_parse_option (c, arg)
return 0;
}
mips_pic = NO_PIC;
mips_abicalls = FALSE;
break;
/* The -xgot option tells the assembler to use 32 offsets when
@ -12430,7 +12435,10 @@ s_option (x)
if (i == 0)
mips_pic = NO_PIC;
else if (i == 2)
{
mips_pic = SVR4_PIC;
mips_abicalls = TRUE;
}
else
as_bad (_(".option pic%d not supported"), i);
@ -12654,6 +12662,7 @@ s_abicalls (ignore)
int ignore ATTRIBUTE_UNUSED;
{
mips_pic = SVR4_PIC;
mips_abicalls = TRUE;
if (USE_GLOBAL_POINTER_OPT)
{
if (g_switch_seen && g_switch_value != 0)
@ -14440,7 +14449,12 @@ mips_elf_final_processing ()
if (mips_any_noreorder)
elf_elfheader (stdoutput)->e_flags |= EF_MIPS_NOREORDER;
if (mips_pic != NO_PIC)
{
elf_elfheader (stdoutput)->e_flags |= EF_MIPS_PIC;
elf_elfheader (stdoutput)->e_flags |= EF_MIPS_CPIC;
}
if (mips_abicalls)
elf_elfheader (stdoutput)->e_flags |= EF_MIPS_CPIC;
/* Set MIPS ELF flags for ASEs. */
if (file_ase_mips16)