PATCH: PR binutils/3826: elf_object_p can't tell freebsd object file from standard ELF object file
Jakub Jelinek
jakub@redhat.com
Tue Mar 13 15:15:00 GMT 2007
More information about the Binutils mailing list
Tue Mar 13 15:15:00 GMT 2007
- Previous message (by thread): PATCH: PR binutils/3826: elf_object_p can't tell freebsd object file from standard ELF object file
- Next message (by thread): PATCH: PR binutils/3826: elf_object_p can't tell freebsd object file from standard ELF object file
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Tue, Mar 13, 2007 at 08:03:55AM -0700, H. J. Lu wrote:
> 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.
Better.
> @@ -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++)
...
> + }
> +
This is a good condition for the searching for more specific target vector.
But you don't do anything for the
ebd->elf_osabi != ELFOSABI_NONE && i_ehdrp->e_ident[EI_OSABI] != ebd->elf_osabi
case - guess in that case you should just always fail. So perhaps
remove && ebd->elf_osabi == ELFOSABI_NONE from the outer if and add
if (ebd->elf_osabi != ELFOSABI_NONE)
goto got_wrong_format_error;
as the first thing inside of the if?
Jakub
- Previous message (by thread): PATCH: PR binutils/3826: elf_object_p can't tell freebsd object file from standard ELF object file
- Next message (by thread): PATCH: PR binutils/3826: elf_object_p can't tell freebsd object file from standard ELF object file
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list