abg-dwarf-reader: migrate more ELF helpers to elf-helpers

This change migrates all ELF helpers related to section lookup to
abg-elf-helpers.{cc,h}. It also homogenizes the interface of those to
always return Elf_Scn* and NULL in case that section can't be found.
Though this smells like a functional change, this latter change is
purely cosmetic.

	* src/abg-dwarf-reader.cc (read_context::{opd_section_,
	ksymtab_section_, ksymtab_reloc_section_, ksymtab_gpl_section_,
	ksymtab_gpl_reloc_section_, ksymtab_strings_section_}): Make these
	data members mutable as they are set by their getter member
	functions, as an implementation detail.
	(read_context::find_symbol_table_section):
	adjust to new interface of elf_helpers::find_symbol_table_section.
	(find_opd_section): use elf_helpers::find_opd_section for lookup.
	(find_ksymtab_section): use elf_helpers::find_ksymtab_section.
	(find_ksymtab_gpl_section): use elf_helpers::find_ksymtab_gpl_section.
	(find_relocation_section): Move out function.
	(get_binary_load_address): Move out function.
	(find_ksymtab_reloc_section): use elf_helpers::find_relocation_section
	(find_ksymtab_gpl_reloc_section): use
	elf_helpers::find_relocation_section
	* src/elf-helpers.cc (find_symbol_table_section): change
	interface to match other find_*_section functions.
	(find_symbol_table_section_index): Adjust for the new interface of
	find_symbol_table_section.
	(find_opd_section): New function.
	(find_ksymtab_section): New function.
	(find_ksymtab_gpl_section): New function.
	(find_relocation_section): New function.
	(get_binary_load_address): New function.
	* src/elf-helpers.h (find_symbol_table_section): Change declaration.
	(find_opd_section): New function declaration.
	(find_ksymtab_section): New function declaration.
	(find_ksymtab_gpl_section): New function declaration.
	(find_relocation_section): New function declaration.
	(get_binary_load_address): New function declaration.

Signed-off-by: Matthias Maennich <maennich@google.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
3 files changed