require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_SYS_EXEC_ECOFF_H_)) {
    eval 'sub _SYS_EXEC_ECOFF_H_ () {1;}' unless defined(&_SYS_EXEC_ECOFF_H_);
    require 'machine/ecoff_machdep.ph';
    eval 'sub ECOFF_HDR_SIZE () {($sizeof{\'struct ecoff_exechdr\'});}' unless defined(&ECOFF_HDR_SIZE);
    eval 'sub ECOFF_OMAGIC () {0407;}' unless defined(&ECOFF_OMAGIC);
    eval 'sub ECOFF_NMAGIC () {0410;}' unless defined(&ECOFF_NMAGIC);
    eval 'sub ECOFF_ZMAGIC () {0413;}' unless defined(&ECOFF_ZMAGIC);
    eval 'sub ECOFF_ROUND {
        my($value, $by) = @_;
	    eval q(((($value) + ($by) - 1) & ~(($by) - 1)));
    }' unless defined(&ECOFF_ROUND);
    eval 'sub ECOFF_BLOCK_ALIGN {
        my($ep, $value) = @_;
	    eval q((($ep)-> ($a->{magic}) ==  &ECOFF_ZMAGIC ?  &ECOFF_ROUND(($value),  &ECOFF_LDPGSZ) : ($value)));
    }' unless defined(&ECOFF_BLOCK_ALIGN);
    eval 'sub ECOFF_TXTOFF {
        my($ep) = @_;
	    eval q((($ep)-> ($a->{magic}) ==  &ECOFF_ZMAGIC ? 0:  &ECOFF_ROUND( &ECOFF_HDR_SIZE + ($ep)-> ($f->{f_nscns}) * $sizeof{\'struct ecoff_scnhdr\'},  &ECOFF_SEGMENT_ALIGNMENT($ep))));
    }' unless defined(&ECOFF_TXTOFF);
    eval 'sub ECOFF_DATOFF {
        my($ep) = @_;
	    eval q(( &ECOFF_BLOCK_ALIGN(($ep),  &ECOFF_TXTOFF($ep) + ($ep)-> ($a->{tsize}))));
    }' unless defined(&ECOFF_DATOFF);
    eval 'sub ECOFF_SEGMENT_ALIGN {
        my($ep, $value) = @_;
	    eval q(( &ECOFF_ROUND(($value), (($ep)-> ($a->{magic}) ==  &ECOFF_ZMAGIC ?  &ECOFF_LDPGSZ :  &ECOFF_SEGMENT_ALIGNMENT($ep)))));
    }' unless defined(&ECOFF_SEGMENT_ALIGN);
    if(defined(&_KERNEL)) {
    }
}
1;
