require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_ARM_ELF_MACHDEP_H_)) {
    eval 'sub _ARM_ELF_MACHDEP_H_ () {1;}' unless defined(&_ARM_ELF_MACHDEP_H_);
    if(defined(&__ARMEB__)) {
	eval 'sub ELF32_MACHDEP_ENDIANNESS () { &ELFDATA2MSB;}' unless defined(&ELF32_MACHDEP_ENDIANNESS);
    } else {
	eval 'sub ELF32_MACHDEP_ENDIANNESS () { &ELFDATA2LSB;}' unless defined(&ELF32_MACHDEP_ENDIANNESS);
    }
    eval 'sub ELF64_MACHDEP_ENDIANNESS () { &XXX;}' unless defined(&ELF64_MACHDEP_ENDIANNESS);
    eval 'sub ELF64_MACHDEP_ID_CASES () {1;}' unless defined(&ELF64_MACHDEP_ID_CASES);
    eval 'sub EF_ARM_RELEXEC () {0x1;}' unless defined(&EF_ARM_RELEXEC);
    eval 'sub EF_ARM_HASENTRY () {0x2;}' unless defined(&EF_ARM_HASENTRY);
    eval 'sub EF_ARM_INTERWORK () {0x4;}' unless defined(&EF_ARM_INTERWORK);
    eval 'sub EF_ARM_SYMSARESORTED () {0x4;}' unless defined(&EF_ARM_SYMSARESORTED);
    eval 'sub EF_ARM_APCS_26 () {0x8;}' unless defined(&EF_ARM_APCS_26);
    eval 'sub EF_ARM_DYNSYMSUSESEGIDX () {0x8;}' unless defined(&EF_ARM_DYNSYMSUSESEGIDX);
    eval 'sub EF_ARM_APCS_FLOAT () {0x10;}' unless defined(&EF_ARM_APCS_FLOAT);
    eval 'sub EF_ARM_MAPSYMSFIRST () {0x10;}' unless defined(&EF_ARM_MAPSYMSFIRST);
    eval 'sub EF_ARM_PIC () {0x20;}' unless defined(&EF_ARM_PIC);
    eval 'sub EF_ARM_ALIGN8 () {0x40;}' unless defined(&EF_ARM_ALIGN8);
    eval 'sub EF_ARM_NEW_ABI () {0x80;}' unless defined(&EF_ARM_NEW_ABI);
    eval 'sub EF_ARM_OLD_ABI () {0x100;}' unless defined(&EF_ARM_OLD_ABI);
    eval 'sub EF_ARM_SOFT_FLOAT () {0x200;}' unless defined(&EF_ARM_SOFT_FLOAT);
    eval 'sub EF_ARM_BE8 () {0x800000;}' unless defined(&EF_ARM_BE8);
    eval 'sub EF_ARM_EABIMASK () {0xff000000;}' unless defined(&EF_ARM_EABIMASK);
    eval 'sub EF_ARM_EABI_VER1 () {0x1000000;}' unless defined(&EF_ARM_EABI_VER1);
    eval 'sub EF_ARM_EABI_VER2 () {0x2000000;}' unless defined(&EF_ARM_EABI_VER2);
    eval 'sub EF_ARM_EABI_VER3 () {0x3000000;}' unless defined(&EF_ARM_EABI_VER3);
    eval 'sub EF_ARM_EABI_VER4 () {0x4000000;}' unless defined(&EF_ARM_EABI_VER4);
    eval 'sub EF_ARM_EABI_VER5 () {0x5000000;}' unless defined(&EF_ARM_EABI_VER5);
    eval 'sub ELF32_MACHDEP_ID_CASES () { &case  &EM_ARM:  &break;;}' unless defined(&ELF32_MACHDEP_ID_CASES);
    eval 'sub ELF32_MACHDEP_ID () { &EM_ARM;}' unless defined(&ELF32_MACHDEP_ID);
    eval 'sub KERN_ELFSIZE () {32;}' unless defined(&KERN_ELFSIZE);
    eval 'sub ARCH_ELFSIZE () {32;}' unless defined(&ARCH_ELFSIZE);
    eval 'sub R_ARM_NONE () {0;}' unless defined(&R_ARM_NONE);
    eval 'sub R_ARM_PC24 () {1;}' unless defined(&R_ARM_PC24);
    eval 'sub R_ARM_ABS32 () {2;}' unless defined(&R_ARM_ABS32);
    eval 'sub R_ARM_REL32 () {3;}' unless defined(&R_ARM_REL32);
    eval 'sub R_ARM_PC13 () {4;}' unless defined(&R_ARM_PC13);
    eval 'sub R_ARM_ABS16 () {5;}' unless defined(&R_ARM_ABS16);
    eval 'sub R_ARM_ABS12 () {6;}' unless defined(&R_ARM_ABS12);
    eval 'sub R_ARM_THM_ABS5 () {7;}' unless defined(&R_ARM_THM_ABS5);
    eval 'sub R_ARM_ABS8 () {8;}' unless defined(&R_ARM_ABS8);
    eval 'sub R_ARM_SBREL32 () {9;}' unless defined(&R_ARM_SBREL32);
    eval 'sub R_ARM_THM_PC22 () {10;}' unless defined(&R_ARM_THM_PC22);
    eval 'sub R_ARM_THM_PC8 () {11;}' unless defined(&R_ARM_THM_PC8);
    eval 'sub R_ARM_AMP_VCALL9 () {12;}' unless defined(&R_ARM_AMP_VCALL9);
    eval 'sub R_ARM_SWI24 () {13;}' unless defined(&R_ARM_SWI24);
    eval 'sub R_ARM_THM_SWI8 () {14;}' unless defined(&R_ARM_THM_SWI8);
    eval 'sub R_ARM_XPC25 () {15;}' unless defined(&R_ARM_XPC25);
    eval 'sub R_ARM_THM_XPC22 () {16;}' unless defined(&R_ARM_THM_XPC22);
    eval 'sub R_ARM_TLS_DTPMOD32 () {17;}' unless defined(&R_ARM_TLS_DTPMOD32);
    eval 'sub R_ARM_TLS_DTPOFF32 () {18;}' unless defined(&R_ARM_TLS_DTPOFF32);
    eval 'sub R_ARM_TLS_TPOFF32 () {19;}' unless defined(&R_ARM_TLS_TPOFF32);
    eval 'sub R_ARM_COPY () {20;}' unless defined(&R_ARM_COPY);
    eval 'sub R_ARM_GLOB_DAT () {21;}' unless defined(&R_ARM_GLOB_DAT);
    eval 'sub R_ARM_JUMP_SLOT () {22;}' unless defined(&R_ARM_JUMP_SLOT);
    eval 'sub R_ARM_RELATIVE () {23;}' unless defined(&R_ARM_RELATIVE);
    eval 'sub R_ARM_GOTOFF () {24;}' unless defined(&R_ARM_GOTOFF);
    eval 'sub R_ARM_GOTPC () {25;}' unless defined(&R_ARM_GOTPC);
    eval 'sub R_ARM_GOT32 () {26;}' unless defined(&R_ARM_GOT32);
    eval 'sub R_ARM_PLT32 () {27;}' unless defined(&R_ARM_PLT32);
    eval 'sub R_ARM_CALL () {28;}' unless defined(&R_ARM_CALL);
    eval 'sub R_ARM_JUMP24 () {29;}' unless defined(&R_ARM_JUMP24);
    eval 'sub R_ARM_THM_JUMP24 () {30;}' unless defined(&R_ARM_THM_JUMP24);
    eval 'sub R_ARM_BASE_ABS () {31;}' unless defined(&R_ARM_BASE_ABS);
    eval 'sub R_ARM_ALU_PCREL_7_0 () {32;}' unless defined(&R_ARM_ALU_PCREL_7_0);
    eval 'sub R_ARM_ALU_PCREL_15_8 () {33;}' unless defined(&R_ARM_ALU_PCREL_15_8);
    eval 'sub R_ARM_ALU_PCREL_23_15 () {34;}' unless defined(&R_ARM_ALU_PCREL_23_15);
    eval 'sub R_ARM_ALU_SBREL_11_0 () {35;}' unless defined(&R_ARM_ALU_SBREL_11_0);
    eval 'sub R_ARM_ALU_SBREL_19_12 () {36;}' unless defined(&R_ARM_ALU_SBREL_19_12);
    eval 'sub R_ARM_ALU_SBREL_27_20 () {37;}' unless defined(&R_ARM_ALU_SBREL_27_20);
    eval 'sub R_ARM_TARGET1 () {38;}' unless defined(&R_ARM_TARGET1);
    eval 'sub R_ARM_SBREL31 () {39;}' unless defined(&R_ARM_SBREL31);
    eval 'sub R_ARM_V4BX () {40;}' unless defined(&R_ARM_V4BX);
    eval 'sub R_ARM_TARGET2 () {41;}' unless defined(&R_ARM_TARGET2);
    eval 'sub R_ARM_PREL31 () {42;}' unless defined(&R_ARM_PREL31);
    eval 'sub R_ARM_MOVW_ABS_NC () {43;}' unless defined(&R_ARM_MOVW_ABS_NC);
    eval 'sub R_ARM_MOVT_ABS () {44;}' unless defined(&R_ARM_MOVT_ABS);
    eval 'sub R_ARM_MOVW_PREL_NC () {45;}' unless defined(&R_ARM_MOVW_PREL_NC);
    eval 'sub R_ARM_MOVT_PREL () {46;}' unless defined(&R_ARM_MOVT_PREL);
    eval 'sub R_ARM_THM_MOVW_ABS_NC () {47;}' unless defined(&R_ARM_THM_MOVW_ABS_NC);
    eval 'sub R_ARM_THM_MOVT_ABS () {48;}' unless defined(&R_ARM_THM_MOVT_ABS);
    eval 'sub R_ARM_THM_MOVW_PREL_NC () {49;}' unless defined(&R_ARM_THM_MOVW_PREL_NC);
    eval 'sub R_ARM_THM_MOVT_PREL () {50;}' unless defined(&R_ARM_THM_MOVT_PREL);
    eval 'sub R_ARM_GNU_VTENTRY () {100;}' unless defined(&R_ARM_GNU_VTENTRY);
    eval 'sub R_ARM_GNU_VTINHERIT () {101;}' unless defined(&R_ARM_GNU_VTINHERIT);
    eval 'sub R_ARM_THM_PC11 () {102;}' unless defined(&R_ARM_THM_PC11);
    eval 'sub R_ARM_THM_PC9 () {103;}' unless defined(&R_ARM_THM_PC9);
    eval 'sub R_ARM_TLS_GD32 () {104;}' unless defined(&R_ARM_TLS_GD32);
    eval 'sub R_ARM_TLS_LDM32 () {105;}' unless defined(&R_ARM_TLS_LDM32);
    eval 'sub R_ARM_TLS_LDO32 () {106;}' unless defined(&R_ARM_TLS_LDO32);
    eval 'sub R_ARM_TLS_IE32 () {107;}' unless defined(&R_ARM_TLS_IE32);
    eval 'sub R_ARM_TLS_LE32 () {108;}' unless defined(&R_ARM_TLS_LE32);
    eval 'sub R_ARM_TLS_LDO12 () {109;}' unless defined(&R_ARM_TLS_LDO12);
    eval 'sub R_ARM_TLS_LE12 () {110;}' unless defined(&R_ARM_TLS_LE12);
    eval 'sub R_ARM_TLS_IE12GP () {111;}' unless defined(&R_ARM_TLS_IE12GP);
    eval 'sub R_ARM_IRELATIVE () {160;}' unless defined(&R_ARM_IRELATIVE);
    eval 'sub R_ARM_RXPC25 () {249;}' unless defined(&R_ARM_RXPC25);
    eval 'sub R_ARM_RSBREL32 () {250;}' unless defined(&R_ARM_RSBREL32);
    eval 'sub R_ARM_THM_RPC22 () {251;}' unless defined(&R_ARM_THM_RPC22);
    eval 'sub R_ARM_RREL32 () {252;}' unless defined(&R_ARM_RREL32);
    eval 'sub R_ARM_RABS32 () {253;}' unless defined(&R_ARM_RABS32);
    eval 'sub R_ARM_RPC24 () {254;}' unless defined(&R_ARM_RPC24);
    eval 'sub R_ARM_RBASE () {255;}' unless defined(&R_ARM_RBASE);
    eval 'sub R_TYPE {
        my($name) = @_;
	    eval q( &__CONCAT( &R_ARM_,$name));
    }' unless defined(&R_TYPE);
    eval 'sub PF_ARM_SB () {0x10000000;}' unless defined(&PF_ARM_SB);
    eval 'sub PF_ARM_PI () {0x20000000;}' unless defined(&PF_ARM_PI);
    eval 'sub PF_ARM_ENTRY () {0x80000000;}' unless defined(&PF_ARM_ENTRY);
    eval 'sub PT_ARM_EXIDX () {( &PT_LOPROC + 1);}' unless defined(&PT_ARM_EXIDX);
    eval 'sub SHF_ENTRYSECT () {0x10000000;}' unless defined(&SHF_ENTRYSECT);
    eval 'sub SHF_COMDEF () {0x80000000;}' unless defined(&SHF_COMDEF);
    eval 'sub STT_ARM_TFUNC () { &STT_LOPROC;}' unless defined(&STT_ARM_TFUNC);
    if(defined(&_KERNEL)) {
	if(defined(&ELFSIZE)) {
	    eval 'sub ELF_MD_PROBE_FUNC () { &ELFNAME2( &arm_netbsd, &probe);}' unless defined(&ELF_MD_PROBE_FUNC);
	    eval 'sub ELF_MD_COREDUMP_SETUP () { &ELFNAME2( &arm_netbsd, &coredump_setup);}' unless defined(&ELF_MD_COREDUMP_SETUP);
	}
    }
}
1;
