require '_h2ph_pre.ph';

# "$Id: kallsyms.h,v 1.1 2001/10/23 17:55:50 arjanv Exp $"
unless(defined(&MODUTILS_KALLSYMS_H)) {
    eval 'sub MODUTILS_KALLSYMS_H () {1;}' unless defined(&MODUTILS_KALLSYMS_H);
    unless(defined(&ELFCLASS32)) {
	if(defined(&__KERNEL__)) {
	    require 'linux/elf.ph';
	} else {
	    require 'elf.ph';
	}
    }
    unless(defined(&ELFCLASSM)) {
	eval 'sub ELFCLASSM () { &ELF_CLASS;}' unless defined(&ELFCLASSM);
    }
    unless(defined(&ElfW)) {
	if((defined(&ELFCLASSM) ? &ELFCLASSM : 0) == (defined(&ELFCLASS32) ? &ELFCLASS32 : 0)) {
	    eval 'sub ElfW {
	        local($x) = @_;
    		eval q( &Elf32_  $x);
	    }' unless defined(&ElfW);
	    eval 'sub ELFW {
	        local($x) = @_;
    		eval q( &ELF32_  $x);
	    }' unless defined(&ELFW);
	} else {
	    eval 'sub ElfW {
	        local($x) = @_;
    		eval q( &Elf64_  $x);
	    }' unless defined(&ElfW);
	    eval 'sub ELFW {
	        local($x) = @_;
    		eval q( &ELF64_  $x);
	    }' unless defined(&ELFW);
	}
    }
    eval 'sub KALLSYMS_SEC_NAME () {"__kallsyms";}' unless defined(&KALLSYMS_SEC_NAME);
    eval 'sub KALLSYMS_IDX () {2;}' unless defined(&KALLSYMS_IDX);
    eval 'sub kallsyms_next_sec {
        local($h,$s) = @_;
	    eval q(( = (($s) + ($h)-> &section_size)));
    }' unless defined(&kallsyms_next_sec);
    eval 'sub kallsyms_next_sym {
        local($h,$s) = @_;
	    eval q(( = (($s) + ($h)-> &symbol_size)));
    }' unless defined(&kallsyms_next_sym);
}
1;
