Hi, please could you add elfosabi marking ("i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD") for freebsd/kfreebsd targets also for x86-64/amd64. Up to now, it is inluded only for i386 and alpha targets. But the comment applies also for amd64: /* 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. */ The only difference in the patch compared to i386/alpha way of adding this marking is that it do not have to support pre FreeBSD 4.1 kernels, as they do not exist for amd64. Thanks in advance.
Created attachment 1190 [details] proposed patch
Hi Petr, I have applied your patch along with these ChangeLog entries. Cheers Nick bfd/ChangeLog 2006-08-02 Petr Salinger <Petr.Salinger@seznam.cz> PR binutils/2983 * elf64-x86-64.c: Add FreeBSD support. (elf64_x86_64_fbsd_post_process_headers): New function. * targets.c (_bfd_target_vector): Add bfd_elf64_x86_64_freebsd_vec. * config.bfd (x64_64-*-freebsd*): Add bfd_elf64_x86_64_freebsd_vec to the targ_selvecs. * configure.in: Add entry for bfd_elf64_x86_64_freebsd_vec. * configure: Regenerate. gas/ChangeLog 2006-08-02 Petr Salinger <Petr.Salinger@seznam.cz> PR binutils/2983 * config/tc-i386.c (md_parse_option): Treat any target starting with elf64_x86_64 as a viable target for the -64 switch. (i386_target_format): For 64-bit ELF flavoured output use ELF_TARGET_FORMAT64. * config/tc-i386.h (ELF_TARGET_FORMAT64): Define. ld/ChangeLog 2006-08-02 Petr Salinger <Petr.Salinger@seznam.cz> PR binutils/2983 * emulparams/elf_x86_64_fbsd.sh (OUTPUT_FORMAT): Define as elf64-x86-64-freebsd.
Many thanks for quick reply and commit into repository. Petr
looks like a follow up to this: http://sourceware.org/ml/binutils/2006-07/msg00220.html cheers