Bug 2983 - [patch] please do FreeBSD elfosabi marking also for amd64
Summary: [patch] please do FreeBSD elfosabi marking also for amd64
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-31 07:01 UTC by Petr.Salinger
Modified: 2006-08-09 00:43 UTC (History)
2 users (show)

See Also:
Host: x86_64-kfreebsd-gnu
Target:
Build:
Last reconfirmed:


Attachments
proposed patch (1.70 KB, patch)
2006-07-31 07:01 UTC, Petr.Salinger
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Petr.Salinger 2006-07-31 07:01:14 UTC
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.
Comment 1 Petr.Salinger 2006-07-31 07:01:54 UTC
Created attachment 1190 [details]
proposed patch
Comment 2 Nick Clifton 2006-08-02 15:49:35 UTC
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.
Comment 3 Petr.Salinger 2006-08-03 14:28:38 UTC
Many thanks for quick reply and commit into repository.

Petr
Comment 4 Mike Frysinger 2006-08-09 00:43:58 UTC
looks like a follow up to this:
http://sourceware.org/ml/binutils/2006-07/msg00220.html

cheers