This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: PR binutils/3826: elf_object_p can't tell freebsd object file from standard ELF object file
- From: "H. J. Lu" <hjl at lucon dot org>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Tue, 13 Mar 2007 08:03:55 -0700
- Subject: Re: PATCH: PR binutils/3826: elf_object_p can't tell freebsd object file from standard ELF object file
- References: <20070104153132.GA24896@lucon.org> <20070104194750.GA30044@lucon.org> <20070105032945.GD12887@bubble.grove.modra.org> <20070105035443.GA32376@lucon.org> <20070105043825.GF12887@bubble.grove.modra.org> <20070105051240.GA4227@lucon.org> <20070313110115.GG1826@sunsite.mff.cuni.cz>
On Tue, Mar 13, 2007 at 12:01:15PM +0100, Jakub Jelinek wrote:
> On Thu, Jan 04, 2007 at 09:12:40PM -0800, H. J. Lu wrote:
> > On Fri, Jan 05, 2007 at 03:08:25PM +1030, Alan Modra wrote:
> > > >
> > > > That is enirely reasonable to reject such object file since it may
> > > > contain info we don't know how to handle properly. If we can handle
> > >
> > > I disagree. We ought to try our best to handle an object file with
> > > an unexpected OSABI, particularly if the unexpected value is
> > > ELFOSABI_NONE.
> > >
> >
> > It is the other way around. GNU linker can handle ELFOSABI_NONE. I
> > believe it is OK to reject an ELF file with an unexpected OSABI, which
> > isn't ELFOSABI_NONE, and we don't know how to handle it properly.
>
> Your patch breaks e.g. MadWifi build on Linux - there is no point
> why Linux binutils should include freebsd vecs and with the strict
> checking of EI_OSABI you added in your patch you disallow != ELFOSABI_NONE
> marked input files which can be perfectly handled by elf_i386.
> http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=230964
>
How about this? We treat ELFOSABI_NONE ELF target like generic ELF
target and match it with any ELF target of the same machine for which
we do not have a specific backend.
H.J.
---
2007-03-13 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/3826
* elf-bfd.h (elf_backend_data): Add elf_osabi.
(_bfd_elf_set_osabi): New.
* elf.c (_bfd_elf_set_osabi): New.
* elf32-hppa.c (elf32_hppa_post_process_headers): Removed.
(elf_backend_post_process_headers): Defined with
_bfd_elf_set_osabi.
(ELF_OSABI): Properly defined for each target.
* elf32-i370.c (i370_elf_post_process_headers): Removed.
(ELF_OSABI): Defined.
(elf_backend_post_process_headers): Defined with
_bfd_elf_set_osabi.
* elf32-i386.c (ELF_OSABI): Defined to ELFOSABI_FREEBSD for
freebsd.
(elf_i386_post_process_headers): Set EI_OSABI with elf_osabi.
* elf32-msp430.c (elf32_msp430_post_process_headers): Removed.
(ELF_OSABI): Defined.
(elf_backend_post_process_headers): Defined with
_bfd_elf_set_osabi.
* elf64-alpha.c (ELF_OSABI): Defined to ELFOSABI_FREEBSD for
freebsd.
(elf64_alpha_fbsd_post_process_headers): Set EI_OSABI with
elf_osabi.
* elf64-hppa.c (elf64_hppa_post_process_headers): Set EI_OSABI
with elf_osabi.
(ELF_OSABI): Properly defined for each target.
(elf_backend_post_process_headers): Defined with
_bfd_elf_set_osabi for Linux.
* elf64-sparc.c (elf64_sparc_fbsd_post_process_headers): Removed.
(ELF_OSABI): Defined to ELFOSABI_FREEBSD for freebsd.
(elf_backend_post_process_headers): Defined with
_bfd_elf_set_osabi.
* elf64-x86-64.c (elf64_x86_64_fbsd_post_process_headers): Removed.
(ELF_OSABI): Defined to ELFOSABI_FREEBSD for freebsd.
(elf_backend_post_process_headers): Defined with
_bfd_elf_set_osabi.
* elfcode.h (elf_object_p): Match the ELFOSABI_NONE ELF target
with any ELF target of the same machine for which we do not
have a specific backend.
* elfxx-ia64.c (elfNN_hpux_post_process_headers): Set EI_OSABI
with elf_osabi.
* elfxx-target.h (ELF_OSABI): Default to ELFOSABI_NONE.
(elfNN_bed): Initialize elf_osabi with ELF_OSABI.
--- bfd/elf-bfd.h.osabi 2007-03-13 06:09:39.000000000 -0700
+++ bfd/elf-bfd.h 2007-03-13 06:44:34.000000000 -0700
@@ -550,6 +550,9 @@ struct elf_backend_data
/* The ELF machine code (EM_xxxx) for this backend. */
int elf_machine_code;
+ /* EI_OSABI. */
+ int elf_osabi;
+
/* The maximum page size for this backend. */
bfd_vma maxpagesize;
@@ -1752,6 +1755,8 @@ extern void bfd_elf_perform_complex_relo
extern bfd_boolean _bfd_elf_setup_sections
(bfd *);
+extern void _bfd_elf_set_osabi (bfd * , struct bfd_link_info *);
+
extern const bfd_target *bfd_elf32_object_p
(bfd *);
extern const bfd_target *bfd_elf32_core_file_p
--- bfd/elf.c.osabi 2007-03-13 06:09:39.000000000 -0700
+++ bfd/elf.c 2007-03-13 06:44:48.000000000 -0700
@@ -9330,3 +9330,14 @@ _bfd_elf_match_sections_by_type (bfd *ab
return elf_section_type (asec) == elf_section_type (bsec);
}
+
+void
+_bfd_elf_set_osabi (bfd * abfd,
+ struct bfd_link_info * link_info ATTRIBUTE_UNUSED)
+{
+ Elf_Internal_Ehdr * i_ehdrp; /* ELF file header, internal form. */
+
+ i_ehdrp = elf_elfheader (abfd);
+
+ i_ehdrp->e_ident[EI_OSABI] = get_elf_backend_data (abfd)->elf_osabi;
+}
--- bfd/elf32-hppa.c.osabi 2007-03-07 06:16:53.000000000 -0800
+++ bfd/elf32-hppa.c 2007-03-13 06:09:40.000000000 -0700
@@ -4601,30 +4601,6 @@ elf32_hppa_finish_dynamic_sections (bfd
return TRUE;
}
-/* Tweak the OSABI field of the elf header. */
-
-static void
-elf32_hppa_post_process_headers (bfd *abfd,
- struct bfd_link_info *info ATTRIBUTE_UNUSED)
-{
- Elf_Internal_Ehdr * i_ehdrp;
-
- i_ehdrp = elf_elfheader (abfd);
-
- if (strcmp (bfd_get_target (abfd), "elf32-hppa-linux") == 0)
- {
- i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_LINUX;
- }
- else if (strcmp (bfd_get_target (abfd), "elf32-hppa-netbsd") == 0)
- {
- i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_NETBSD;
- }
- else
- {
- i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_HPUX;
- }
-}
-
/* Called when writing out an object file to decide the type of a
symbol. */
static int
@@ -4663,7 +4639,7 @@ elf32_hppa_elf_get_symbol_type (Elf_Inte
#define elf_backend_grok_psinfo elf32_hppa_grok_psinfo
#define elf_backend_object_p elf32_hppa_object_p
#define elf_backend_final_write_processing elf_hppa_final_write_processing
-#define elf_backend_post_process_headers elf32_hppa_post_process_headers
+#define elf_backend_post_process_headers _bfd_elf_set_osabi
#define elf_backend_get_symbol_type elf32_hppa_elf_get_symbol_type
#define elf_backend_reloc_type_class elf32_hppa_reloc_type_class
#define elf_backend_action_discarded elf_hppa_action_discarded
@@ -4682,6 +4658,7 @@ elf32_hppa_elf_get_symbol_type (Elf_Inte
#define ELF_ARCH bfd_arch_hppa
#define ELF_MACHINE_CODE EM_PARISC
#define ELF_MAXPAGESIZE 0x1000
+#define ELF_OSABI ELFOSABI_HPUX
#define elf32_bed elf32_hppa_hpux_bed
#include "elf32-target.h"
@@ -4690,6 +4667,8 @@ elf32_hppa_elf_get_symbol_type (Elf_Inte
#define TARGET_BIG_SYM bfd_elf32_hppa_linux_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf32-hppa-linux"
+#undef ELF_OSABI
+#define ELF_OSABI ELFOSABI_LINUX
#undef elf32_bed
#define elf32_bed elf32_hppa_linux_bed
@@ -4699,6 +4678,8 @@ elf32_hppa_elf_get_symbol_type (Elf_Inte
#define TARGET_BIG_SYM bfd_elf32_hppa_nbsd_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf32-hppa-netbsd"
+#undef ELF_OSABI
+#define ELF_OSABI ELFOSABI_NETBSD
#undef elf32_bed
#define elf32_bed elf32_hppa_netbsd_bed
--- bfd/elf32-i370.c.osabi 2007-03-07 06:16:53.000000000 -0800
+++ bfd/elf32-i370.c 2007-03-13 06:09:40.000000000 -0700
@@ -1417,16 +1417,6 @@ i370_elf_relocate_section (bfd *output_b
return ret;
}
-
-static void
-i370_elf_post_process_headers (bfd * abfd,
- struct bfd_link_info * link_info ATTRIBUTE_UNUSED)
-{
- Elf_Internal_Ehdr * i_ehdrp; /* Elf file header, internal form. */
-
- i_ehdrp = elf_elfheader (abfd);
- i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_LINUX;
-}
#define TARGET_BIG_SYM bfd_elf32_i370_vec
#define TARGET_BIG_NAME "elf32-i370"
@@ -1436,6 +1426,8 @@ i370_elf_post_process_headers (bfd * abf
#define ELF_MACHINE_ALT1 EM_I370_OLD
#endif
#define ELF_MAXPAGESIZE 0x1000
+#define ELF_OSABI ELFOSABI_LINUX
+
#define elf_info_to_howto i370_elf_info_to_howto
#define elf_backend_plt_not_loaded 1
@@ -1456,7 +1448,7 @@ i370_elf_post_process_headers (bfd * abf
#define elf_backend_section_from_shdr i370_elf_section_from_shdr
#define elf_backend_adjust_dynamic_symbol i370_elf_adjust_dynamic_symbol
#define elf_backend_check_relocs i370_elf_check_relocs
-#define elf_backend_post_process_headers i370_elf_post_process_headers
+#define elf_backend_post_process_headers _bfd_elf_set_osabi
static int
i370_noop (void)
--- bfd/elf32-i386.c.osabi 2007-03-13 06:09:39.000000000 -0700
+++ bfd/elf32-i386.c 2007-03-13 06:09:40.000000000 -0700
@@ -3889,6 +3889,8 @@ elf_i386_hash_symbol (struct elf_link_ha
#define TARGET_LITTLE_SYM bfd_elf32_i386_freebsd_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf32-i386-freebsd"
+#undef ELF_OSABI
+#define ELF_OSABI ELFOSABI_FREEBSD
/* The kernel recognizes executables as valid only if they carry a
"FreeBSD" label in the ELF header. So we put this label on all
@@ -3903,7 +3905,7 @@ elf_i386_post_process_headers (bfd *abfd
i_ehdrp = elf_elfheader (abfd);
/* Put an ABI label supported by FreeBSD >= 4.1. */
- i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD;
+ i_ehdrp->e_ident[EI_OSABI] = get_elf_backend_data (abfd)->elf_osabi;
#ifdef OLD_FREEBSD_ABI_LABEL
/* The ABI label supported by FreeBSD <= 4.0 is quite nonstandard. */
memcpy (&i_ehdrp->e_ident[EI_ABIVERSION], "FreeBSD", 8);
@@ -3923,7 +3925,7 @@ elf_i386_post_process_headers (bfd *abfd
#define TARGET_LITTLE_SYM bfd_elf32_i386_vxworks_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf32-i386-vxworks"
-
+#undef ELF_OSABI
/* Like elf_i386_link_hash_table_create but with tweaks for VxWorks. */
--- bfd/elf32-msp430.c.osabi 2007-03-07 06:16:53.000000000 -0800
+++ bfd/elf32-msp430.c 2007-03-13 06:09:40.000000000 -0700
@@ -656,21 +656,6 @@ elf32_msp430_object_p (bfd * abfd)
return bfd_default_set_arch_mach (abfd, bfd_arch_msp430, e_set);
}
-static void
-elf32_msp430_post_process_headers (bfd * abfd,
- struct bfd_link_info * link_info ATTRIBUTE_UNUSED)
-{
- Elf_Internal_Ehdr * i_ehdrp; /* ELF file header, internal form. */
-
- i_ehdrp = elf_elfheader (abfd);
-
-#ifndef ELFOSABI_STANDALONE
-#define ELFOSABI_STANDALONE 255
-#endif
-
- i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_STANDALONE;
-}
-
/* These functions handle relaxing for the msp430.
Relaxation required only in two cases:
- Bad hand coding like jumps from one section to another or
@@ -1174,6 +1159,7 @@ error_return:
#define ELF_MACHINE_CODE EM_MSP430
#define ELF_MACHINE_ALT1 EM_MSP430_OLD
#define ELF_MAXPAGESIZE 1
+#define ELF_OSABI ELFOSABI_STANDALONE
#define TARGET_LITTLE_SYM bfd_elf32_msp430_vec
#define TARGET_LITTLE_NAME "elf32-msp430"
@@ -1185,7 +1171,7 @@ error_return:
#define elf_backend_can_gc_sections 1
#define elf_backend_final_write_processing bfd_elf_msp430_final_write_processing
#define elf_backend_object_p elf32_msp430_object_p
-#define elf_backend_post_process_headers elf32_msp430_post_process_headers
+#define elf_backend_post_process_headers _bfd_elf_set_osabi
#define bfd_elf32_bfd_relax_section msp430_elf_relax_section
#include "elf32-target.h"
--- bfd/elf64-alpha.c.osabi 2007-03-07 06:16:55.000000000 -0800
+++ bfd/elf64-alpha.c 2007-03-13 06:09:40.000000000 -0700
@@ -5354,6 +5354,8 @@ static const struct elf_size_info alpha_
#define TARGET_LITTLE_SYM bfd_elf64_alpha_freebsd_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf64-alpha-freebsd"
+#undef ELF_OSABI
+#define ELF_OSABI ELFOSABI_FREEBSD
/* The kernel recognizes executables as valid only if they carry a
"FreeBSD" label in the ELF header. So we put this label on all
@@ -5368,7 +5370,7 @@ elf64_alpha_fbsd_post_process_headers (b
i_ehdrp = elf_elfheader (abfd);
/* Put an ABI label supported by FreeBSD >= 4.1. */
- i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD;
+ i_ehdrp->e_ident[EI_OSABI] = get_elf_backend_data (abfd)->elf_osabi;
#ifdef OLD_FREEBSD_ABI_LABEL
/* The ABI label supported by FreeBSD <= 4.0 is quite nonstandard. */
memcpy (&i_ehdrp->e_ident[EI_ABIVERSION], "FreeBSD", 8);
--- bfd/elf64-hppa.c.osabi 2007-01-27 18:15:02.000000000 -0800
+++ bfd/elf64-hppa.c 2007-03-13 06:09:40.000000000 -0700
@@ -1198,16 +1198,9 @@ elf64_hppa_post_process_headers (abfd, l
Elf_Internal_Ehdr * i_ehdrp;
i_ehdrp = elf_elfheader (abfd);
-
- if (strcmp (bfd_get_target (abfd), "elf64-hppa-linux") == 0)
- {
- i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_LINUX;
- }
- else
- {
- i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_HPUX;
- i_ehdrp->e_ident[EI_ABIVERSION] = 1;
- }
+
+ i_ehdrp->e_ident[EI_OSABI] = get_elf_backend_data (abfd)->elf_osabi;
+ i_ehdrp->e_ident[EI_ABIVERSION] = 1;
}
/* Create function descriptor section (.opd). This section is called .opd
@@ -2800,6 +2793,8 @@ const struct elf_size_info hppa64_elf_si
/* This is not strictly correct. The maximum page size for PA2.0 is
64M. But everything still uses 4k. */
#define ELF_MAXPAGESIZE 0x1000
+#define ELF_OSABI ELFOSABI_HPUX
+
#define bfd_elf64_bfd_reloc_type_lookup elf_hppa_reloc_type_lookup
#define bfd_elf64_bfd_is_local_label_name elf_hppa_is_local_label_name
#define elf_info_to_howto elf_hppa_info_to_howto
@@ -2874,6 +2869,10 @@ const struct elf_size_info hppa64_elf_si
#define TARGET_BIG_SYM bfd_elf64_hppa_linux_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf64-hppa-linux"
+#undef ELF_OSABI
+#define ELF_OSABI ELFOSABI_LINUX
+#undef elf_backend_post_process_headers
+#define elf_backend_post_process_headers _bfd_elf_set_osabi
#undef elf64_bed
#define elf64_bed elf64_hppa_linux_bed
--- bfd/elf64-sparc.c.osabi 2006-10-22 11:44:54.000000000 -0700
+++ bfd/elf64-sparc.c 2007-03-13 06:09:40.000000000 -0700
@@ -910,25 +910,11 @@ const struct elf_size_info elf64_sparc_s
#define TARGET_BIG_SYM bfd_elf64_sparc_freebsd_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf64-sparc-freebsd"
-
-/* The kernel recognizes executables as valid only if they carry a
- "FreeBSD" label in the ELF header. So we put this label on all
- executables and (for simplicity) also all other object files. */
-
-static void
-elf64_sparc_fbsd_post_process_headers (bfd *abfd,
- struct bfd_link_info *info ATTRIBUTE_UNUSED)
-{
- Elf_Internal_Ehdr *i_ehdrp; /* ELF file header, internal form. */
-
- i_ehdrp = elf_elfheader (abfd);
-
- /* Put an ABI label supported by FreeBSD >= 4.1 */
- i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD;
-}
+#undef ELF_OSABI
+#define ELF_OSABI ELFOSABI_FREEBSD
#undef elf_backend_post_process_headers
-#define elf_backend_post_process_headers elf64_sparc_fbsd_post_process_headers
+#define elf_backend_post_process_headers _bfd_elf_set_osabi
#undef elf64_bed
#define elf64_bed elf64_sparc_fbsd_bed
--- bfd/elf64-x86-64.c.osabi 2007-03-13 06:09:39.000000000 -0700
+++ bfd/elf64-x86-64.c 2007-03-13 06:45:45.000000000 -0700
@@ -3761,24 +3761,11 @@ static const struct bfd_elf_special_sect
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf64-x86-64-freebsd"
-/* The kernel recognizes executables as valid only if they carry a
- "FreeBSD" label in the ELF header. So we put this label on all
- executables and (for simplicity) also all other object files. */
-
-static void
-elf64_x86_64_fbsd_post_process_headers (bfd * abfd,
- struct bfd_link_info * link_info ATTRIBUTE_UNUSED)
-{
- Elf_Internal_Ehdr * i_ehdrp; /* ELF file header, internal form. */
-
- i_ehdrp = elf_elfheader (abfd);
-
- /* Put an ABI label supported by FreeBSD >= 4.1. */
- i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD;
-}
+#undef ELF_OSABI
+#define ELF_OSABI ELFOSABI_FREEBSD
#undef elf_backend_post_process_headers
-#define elf_backend_post_process_headers elf64_x86_64_fbsd_post_process_headers
+#define elf_backend_post_process_headers _bfd_elf_set_osabi
#undef elf64_bed
#define elf64_bed elf64_x86_64_fbsd_bed
--- bfd/elfcode.h.osabi 2007-03-13 07:18:21.000000000 -0700
+++ bfd/elfcode.h 2007-03-13 08:02:34.000000000 -0700
@@ -500,6 +500,7 @@ elf_object_p (bfd *abfd)
struct bfd_preserve preserve;
asection *s;
bfd_size_type amt;
+ const bfd_target * const *target_ptr;
preserve.marker = NULL;
@@ -586,8 +587,6 @@ elf_object_p (bfd *abfd)
&& (ebd->elf_machine_alt2 == 0
|| i_ehdrp->e_machine != ebd->elf_machine_alt2))
{
- const bfd_target * const *target_ptr;
-
if (ebd->elf_machine_code != EM_NONE)
goto got_wrong_format_error;
@@ -628,6 +627,37 @@ elf_object_p (bfd *abfd)
goto got_no_match;
}
+ if (ebd->elf_machine_code != EM_NONE
+ && ebd->elf_osabi == ELFOSABI_NONE
+ && i_ehdrp->e_ident[EI_OSABI] != ebd->elf_osabi)
+ {
+ /* This is the ELFOSABI_NONE ELF target. Let it match any ELF
+ target of the same machine for which we do not have a specific
+ backend. */
+ for (target_ptr = bfd_target_vector;
+ *target_ptr != NULL;
+ target_ptr++)
+ {
+ const struct elf_backend_data *back;
+
+ if (*target_ptr == abfd->xvec
+ || (*target_ptr)->flavour != bfd_target_elf_flavour)
+ continue;
+ back = (const struct elf_backend_data *) (*target_ptr)->backend_data;
+ if (back->elf_osabi == i_ehdrp->e_ident[EI_OSABI]
+ && (back->elf_machine_code == i_ehdrp->e_machine
+ || (back->elf_machine_alt1 != 0
+ && back->elf_machine_alt1 == i_ehdrp->e_machine)
+ || (back->elf_machine_alt2 != 0
+ && back->elf_machine_alt2 == i_ehdrp->e_machine)))
+ {
+ /* target_ptr is an ELF backend which matches this
+ object file, so reject the ELFOSABI_NONE ELF target. */
+ goto got_wrong_format_error;
+ }
+ }
+ }
+
if (i_ehdrp->e_shoff != 0)
{
bfd_signed_vma where = i_ehdrp->e_shoff;
--- bfd/elfxx-ia64.c.osabi 2007-03-13 06:09:39.000000000 -0700
+++ bfd/elfxx-ia64.c 2007-03-13 06:09:40.000000000 -0700
@@ -5682,7 +5682,7 @@ elfNN_hpux_post_process_headers (abfd, i
{
Elf_Internal_Ehdr *i_ehdrp = elf_elfheader (abfd);
- i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_HPUX;
+ i_ehdrp->e_ident[EI_OSABI] = get_elf_backend_data (abfd)->elf_osabi;
i_ehdrp->e_ident[EI_ABIVERSION] = 1;
}
@@ -5852,6 +5852,8 @@ elfNN_hpux_backend_symbol_processing (bf
#undef ELF_MAXPAGESIZE
#define ELF_MAXPAGESIZE 0x1000 /* 4K */
#undef ELF_COMMONPAGESIZE
+#undef ELF_OSABI
+#define ELF_OSABI ELFOSABI_HPUX
#undef elfNN_bed
#define elfNN_bed elfNN_ia64_hpux_bed
--- bfd/elfxx-target.h.osabi 2007-03-01 14:53:14.000000000 -0800
+++ bfd/elfxx-target.h 2007-03-13 06:45:22.000000000 -0700
@@ -291,6 +291,10 @@
#define elf_info_to_howto_rel 0
#endif
+#ifndef ELF_OSABI
+#define ELF_OSABI ELFOSABI_NONE
+#endif
+
#ifndef ELF_MAXPAGESIZE
#error ELF_MAXPAGESIZE is not defined
#define ELF_MAXPAGESIZE 1
@@ -589,6 +593,7 @@ static struct elf_backend_data elfNN_bed
{
ELF_ARCH, /* arch */
ELF_MACHINE_CODE, /* elf_machine_code */
+ ELF_OSABI, /* elf_osabi */
ELF_MAXPAGESIZE, /* maxpagesize */
ELF_MINPAGESIZE, /* minpagesize */
ELF_COMMONPAGESIZE, /* commonpagesize */