Only check EF_xxx flags if the EABI version number is unknown.
This commit is contained in:
parent
5f8a9d91e7
commit
fc830a8329
|
@ -1,3 +1,15 @@
|
||||||
|
2000-04-06 Nick Clifton <nickc@cygnus.com>
|
||||||
|
|
||||||
|
* elf32-arm.h (elf32_arm_set_private_flags): Only check for
|
||||||
|
EF_INTERWORK if this is an unknown EABI.
|
||||||
|
(elf32_arm_merge_private_bfd_data): Check EABI version
|
||||||
|
numbers. Only check EF_xxx flags if the EABI version number
|
||||||
|
is unknown.
|
||||||
|
(elf32_arm_check_private_bfd_data): Only check EF_xxx flags
|
||||||
|
if the EABI version number is unknown.
|
||||||
|
(elf32_arm_print_private_bfd_data): Only decode EF_xxx flags
|
||||||
|
if the EABI version number is unknown.
|
||||||
|
|
||||||
Wed Apr 5 22:04:20 2000 J"orn Rennecke <amylaar@cygnus.co.uk>
|
Wed Apr 5 22:04:20 2000 J"orn Rennecke <amylaar@cygnus.co.uk>
|
||||||
|
|
||||||
* reloc.c (_bfd_relocate_contents): Add BFD_RELOC_SH_LOOP_START and
|
* reloc.c (_bfd_relocate_contents): Add BFD_RELOC_SH_LOOP_START and
|
||||||
|
|
|
@ -1886,6 +1886,8 @@ elf32_arm_set_private_flags (abfd, flags)
|
||||||
{
|
{
|
||||||
if (elf_flags_init (abfd)
|
if (elf_flags_init (abfd)
|
||||||
&& elf_elfheader (abfd)->e_flags != flags)
|
&& elf_elfheader (abfd)->e_flags != flags)
|
||||||
|
{
|
||||||
|
if (EF_ARM_EABI_VERSION (flags) == EF_ARM_EABI_UNKNOWN)
|
||||||
{
|
{
|
||||||
if (flags & EF_INTERWORK)
|
if (flags & EF_INTERWORK)
|
||||||
_bfd_error_handler (_ ("\
|
_bfd_error_handler (_ ("\
|
||||||
|
@ -1896,6 +1898,7 @@ Warning: Not setting interwork flag of %s since it has already been specified as
|
||||||
Warning: Clearing the interwork flag of %s due to outside request"),
|
Warning: Clearing the interwork flag of %s due to outside request"),
|
||||||
bfd_get_filename (abfd));
|
bfd_get_filename (abfd));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
elf_elfheader (abfd)->e_flags = flags;
|
elf_elfheader (abfd)->e_flags = flags;
|
||||||
|
@ -1905,7 +1908,7 @@ Warning: Clearing the interwork flag of %s due to outside request"),
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Copy backend specific data from one object module to another */
|
/* Copy backend specific data from one object module to another. */
|
||||||
static boolean
|
static boolean
|
||||||
elf32_arm_copy_private_bfd_data (ibfd, obfd)
|
elf32_arm_copy_private_bfd_data (ibfd, obfd)
|
||||||
bfd *ibfd;
|
bfd *ibfd;
|
||||||
|
@ -1921,7 +1924,9 @@ elf32_arm_copy_private_bfd_data (ibfd, obfd)
|
||||||
in_flags = elf_elfheader (ibfd)->e_flags;
|
in_flags = elf_elfheader (ibfd)->e_flags;
|
||||||
out_flags = elf_elfheader (obfd)->e_flags;
|
out_flags = elf_elfheader (obfd)->e_flags;
|
||||||
|
|
||||||
if (elf_flags_init (obfd) && in_flags != out_flags)
|
if (elf_flags_init (obfd)
|
||||||
|
&& EF_ARM_EABI_VERSION (out_flags) == EF_ARM_EABI_UNKNOWN
|
||||||
|
&& in_flags != out_flags)
|
||||||
{
|
{
|
||||||
/* Cannot mix PIC and non-PIC code. */
|
/* Cannot mix PIC and non-PIC code. */
|
||||||
if ((in_flags & EF_PIC) != (out_flags & EF_PIC))
|
if ((in_flags & EF_PIC) != (out_flags & EF_PIC))
|
||||||
|
@ -2018,6 +2023,18 @@ elf32_arm_merge_private_bfd_data (ibfd, obfd)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
/* Complain about various flag mismatches. */
|
/* Complain about various flag mismatches. */
|
||||||
|
if (EF_ARM_EABI_VERSION (in_flags) != EF_ARM_EABI_VERSION (out_flags))
|
||||||
|
{
|
||||||
|
_bfd_error_handler (_("\
|
||||||
|
Error: %s compiled for EABI version %d, whereas %s is compiled for version %d"),
|
||||||
|
bfd_get_filename (ibfd),
|
||||||
|
(in_flags & EF_ARM_EABIMASK) >> 24,
|
||||||
|
bfd_get_filename (obfd),
|
||||||
|
(out_flags & EF_ARM_EABIMASK) >> 24);
|
||||||
|
}
|
||||||
|
else if (EF_ARM_EABI_VERSION (in_flags) != EF_ARM_EABI_UNKNOWN)
|
||||||
|
/* Not sure what needs to be checked for EABI versions >= 1. */
|
||||||
|
return true;
|
||||||
|
|
||||||
if ((in_flags & EF_APCS_26) != (out_flags & EF_APCS_26))
|
if ((in_flags & EF_APCS_26) != (out_flags & EF_APCS_26))
|
||||||
_bfd_error_handler (_ ("\
|
_bfd_error_handler (_ ("\
|
||||||
|
@ -2064,36 +2081,80 @@ elf32_arm_print_private_bfd_data (abfd, ptr)
|
||||||
PTR ptr;
|
PTR ptr;
|
||||||
{
|
{
|
||||||
FILE * file = (FILE *) ptr;
|
FILE * file = (FILE *) ptr;
|
||||||
|
unsigned long flags;
|
||||||
|
|
||||||
BFD_ASSERT (abfd != NULL && ptr != NULL);
|
BFD_ASSERT (abfd != NULL && ptr != NULL);
|
||||||
|
|
||||||
/* Print normal ELF private data. */
|
/* Print normal ELF private data. */
|
||||||
_bfd_elf_print_private_bfd_data (abfd, ptr);
|
_bfd_elf_print_private_bfd_data (abfd, ptr);
|
||||||
|
|
||||||
|
flags = elf_elfheader (abfd)->e_flags;
|
||||||
/* Ignore init flag - it may not be set, despite the flags field containing valid data. */
|
/* Ignore init flag - it may not be set, despite the flags field containing valid data. */
|
||||||
|
|
||||||
/* xgettext:c-format */
|
/* xgettext:c-format */
|
||||||
fprintf (file, _ ("private flags = %lx:"), elf_elfheader (abfd)->e_flags);
|
fprintf (file, _ ("private flags = %lx:"), elf_elfheader (abfd)->e_flags);
|
||||||
|
|
||||||
if (elf_elfheader (abfd)->e_flags & EF_INTERWORK)
|
switch (EF_ARM_EABI_VERSION (flags))
|
||||||
|
{
|
||||||
|
case EF_ARM_EABI_UNKNOWN:
|
||||||
|
/* The following flag bits are GNU extenstions and not part of the
|
||||||
|
official ARM ELF extended ABI. Hence they are only decoded if
|
||||||
|
the EABI version is not set. */
|
||||||
|
if (flags & EF_INTERWORK)
|
||||||
fprintf (file, _ (" [interworking enabled]"));
|
fprintf (file, _ (" [interworking enabled]"));
|
||||||
else
|
|
||||||
fprintf (file, _ (" [interworking not enabled]"));
|
|
||||||
|
|
||||||
if (elf_elfheader (abfd)->e_flags & EF_APCS_26)
|
if (flags & EF_APCS_26)
|
||||||
fprintf (file, _ (" [APCS-26]"));
|
fprintf (file, _ (" [APCS-26]"));
|
||||||
else
|
else
|
||||||
fprintf (file, _ (" [APCS-32]"));
|
fprintf (file, _ (" [APCS-32]"));
|
||||||
|
|
||||||
if (elf_elfheader (abfd)->e_flags & EF_APCS_FLOAT)
|
if (flags & EF_APCS_FLOAT)
|
||||||
fprintf (file, _ (" [floats passed in float registers]"));
|
fprintf (file, _ (" [floats passed in float registers]"));
|
||||||
else
|
|
||||||
fprintf (file, _ (" [floats passed in integer registers]"));
|
|
||||||
|
|
||||||
if (elf_elfheader (abfd)->e_flags & EF_PIC)
|
if (flags & EF_PIC)
|
||||||
fprintf (file, _ (" [position independent]"));
|
fprintf (file, _ (" [position independent]"));
|
||||||
|
|
||||||
|
if (flags & EF_NEW_ABI)
|
||||||
|
fprintf (file, _ (" [new ABI]"));
|
||||||
|
|
||||||
|
if (flags & EF_OLD_ABI)
|
||||||
|
fprintf (file, _ (" [old ABI]"));
|
||||||
|
|
||||||
|
if (flags & EF_SOFT_FLOAT)
|
||||||
|
fprintf (file, _ (" [software FP]"));
|
||||||
|
|
||||||
|
flags &= ~(EF_INTERWORK | EF_APCS_26 | EF_APCS_FLOAT | EF_PIC
|
||||||
|
| EF_NEW_ABI | EF_OLD_ABI | EF_SOFT_FLOAT);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case EF_ARM_EABI_VER1:
|
||||||
|
fprintf (file, _ (" [Version1 EABI]"));
|
||||||
|
|
||||||
|
if (flags & EF_ARM_SYMSARESORTED)
|
||||||
|
fprintf (file, _ (" [sorted symbol table]"));
|
||||||
else
|
else
|
||||||
fprintf (file, _ (" [absolute position]"));
|
fprintf (file, _ (" [unsorted symbol table]"));
|
||||||
|
|
||||||
|
flags &= ~ EF_ARM_SYMSARESORTED;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
fprintf (file, _ (" <EABI version unrecognised>"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
flags &= ~ EF_ARM_EABIMASK;
|
||||||
|
|
||||||
|
if (flags & EF_ARM_RELEXEC)
|
||||||
|
fprintf (file, _ (" [relocatable executable]"));
|
||||||
|
|
||||||
|
if (flags & EF_ARM_HASENTRY)
|
||||||
|
fprintf (file, _ (" [has entry point]"));
|
||||||
|
|
||||||
|
flags &= ~ (EF_ARM_RELEXEC | EF_ARM_HASENTRY);
|
||||||
|
|
||||||
|
if (flags)
|
||||||
|
fprintf (file, _ ("<Unrecognised flag bits set>"));
|
||||||
|
|
||||||
fputc ('\n', file);
|
fputc ('\n', file);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue