diff options
author | Ian Lance Taylor <ian@airs.com> | 2009-03-24 00:31:29 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 2009-03-24 00:31:29 +0000 |
commit | 36959681867a70c8f48055ffb22b6f037596b762 (patch) | |
tree | 46b20dfcf1d79a1ac3f5e12d2e03a0cde21e912e /gold/output.cc | |
parent | d739bf00691a4e5a8c002dc7eb5d49bb4ad95d24 (diff) | |
download | gdb-36959681867a70c8f48055ffb22b6f037596b762.zip gdb-36959681867a70c8f48055ffb22b6f037596b762.tar.gz gdb-36959681867a70c8f48055ffb22b6f037596b762.tar.bz2 |
2009-03-23 Ian Lance Taylor <iant@google.com>
* freebsd.h: New file.
* i386.cc: Include "freebsd.h".
(Target_i386): Derive from Target_freebsd rather than
Sized_target.
(Target_selector_i386): Derive from Target_selector_freebsd rather
than Target_selector.
* x86_64.cc: Include "freebsd.h".
(Target_x86_64): Derive from Target_freebsd rather than
Sized_target.
(Target_selector_x86_64): Derive from Target_selector_freebsd
rather than Target_selector.
* target.h (class Target): Add adjust_elf_header and
do_adjust_elf_header.
* output.cc (Output_file_header:: do_sized_write): Call target
adjust_elf_header routine.
* configure.tgt: Set targ_osabi.
* configure.ac: Define GOLD_DEFAULT_OSABI.
* parameters.cc (Parameters::default_target): Pass
GOLD_DEFAULT_OSABI to select_target.
* target-select.h (class Target_selector): Make instantiate_target
protected rather than private.
* Makefile.am (HFILES): Add freebsd.h.
* configure, Makefile.in, config.in: Rebuild.
Diffstat (limited to 'gold/output.cc')
-rw-r--r-- | gold/output.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gold/output.cc b/gold/output.cc index 2f9db62..cb9e038 100644 --- a/gold/output.cc +++ b/gold/output.cc @@ -432,7 +432,6 @@ Output_file_header::do_sized_write(Output_file* of) ? elfcpp::ELFDATA2MSB : elfcpp::ELFDATA2LSB); e_ident[elfcpp::EI_VERSION] = elfcpp::EV_CURRENT; - // FIXME: Some targets may need to set EI_OSABI and EI_ABIVERSION. oehdr.put_e_ident(e_ident); elfcpp::ET e_type; @@ -489,6 +488,10 @@ Output_file_header::do_sized_write(Output_file* of) else oehdr.put_e_shstrndx(elfcpp::SHN_XINDEX); + // Let the target adjust the ELF header, e.g., to set EI_OSABI in + // the e_ident field. + parameters->target().adjust_elf_header(view, ehdr_size); + of->write_output_view(0, ehdr_size, view); } |