Cosmetic improvements for OSABI access.

Add accessor methods to elfcpp::Ehdr class for EI_OSABI and EI_ABIVERSION;
use those to simplify initialization of Osabi class and eliminate the need
to template the class.

elfcpp/
	* elfcpp.h (class Ehdr): Add get_ei_osabi and get_ei_abiversion methods.

gold/
	* dwp.cc (class Dwo_file): Use new Ehdr::get_ei_osabi and
	get_ei_abiversion methods.
	* incremental.cc (make_sized_incremental_binary): Likewise.
	* object.cc (Sized_relobj_file::Sized_relobj_file): Likewise.
	(make_elf_sized_object): Likewise.
	* object.h (class Osabi): Make the class untemplated.
This commit is contained in:
Cary Coutant
2020-12-15 14:37:22 -08:00
parent 8947abe6bf
commit 2b2d74f4a1
7 changed files with 33 additions and 14 deletions

View File

@@ -1107,8 +1107,8 @@ Dwo_file::sized_make_object(const unsigned char* p, Input_file* input_file,
if (output_file != NULL)
output_file->record_target_info(
this->name_, ehdr.get_e_machine(), size, big_endian,
ehdr.get_e_ident()[elfcpp::EI_OSABI],
ehdr.get_e_ident()[elfcpp::EI_ABIVERSION]);
ehdr.get_ei_osabi(),
ehdr.get_ei_abiversion());
return obj;
}