corrected

This commit is contained in:
ceriel 1987-08-12 21:36:30 +00:00
parent a0f89188b9
commit 4769a76ca0
2 changed files with 18 additions and 4 deletions

View file

@ -159,6 +159,8 @@ main(argc, argv)
datasize= outsect[BSSSG].os_base - outsect[ROMSG].os_base ; datasize= outsect[BSSSG].os_base - outsect[ROMSG].os_base ;
if (! follows(&outsect[DATASG], &outsect[ROMSG])) if (! follows(&outsect[DATASG], &outsect[ROMSG]))
fatal("data segment must follow rom\n") ; fatal("data segment must follow rom\n") ;
outsect[ROMSG].os_size = outsect[DATASG].os_base - outsect[ROMSG].os_base;
outsect[DATASG].os_size = outsect[BSSSG].os_base - outsect[DATASG].os_base;
} else } else
if ( outsect[DATASG].os_lign == 0x20000 ) { if ( outsect[DATASG].os_lign == 0x20000 ) {
/* 410/413 file with ROMSG in instruction space */ /* 410/413 file with ROMSG in instruction space */
@ -166,21 +168,26 @@ main(argc, argv)
magic= NMAGIC ; magic= NMAGIC ;
textsize= (outsect[ROMSG].os_base - outsect[TEXTSG].os_base) + textsize= (outsect[ROMSG].os_base - outsect[TEXTSG].os_base) +
outsect[ROMSG].os_size ; outsect[ROMSG].os_size ;
datasize= outsect[DATASG].os_size ;
if (! follows(&outsect[ROMSG],&outsect[TEXTSG].os_base)) if (! follows(&outsect[ROMSG],&outsect[TEXTSG].os_base))
fatal("rom segment must follow text\n") ; fatal("rom segment must follow text\n") ;
outsect[TEXTSG].os_size = outsect[ROMSG].os_base - outsect[TEXTSG].os_base;
outsect[DATASG].os_size = outsect[BSSSG].os_base - outsect[DATASG].os_base;
datasize= outsect[DATASG].os_size ;
} else { } else {
/* Plain 407 file */ /* Plain 407 file */
rom_in_data = 0; rom_in_data = 0;
magic= OMAGIC ; magic= OMAGIC ;
textsize= (outsect[DATASG].os_base - outsect[TEXTSG].os_base); textsize= (outsect[DATASG].os_base - outsect[TEXTSG].os_base);
datasize= outsect[DATASG].os_size ;
if (!unresolved) { if (!unresolved) {
if (! follows(&outsect[ROMSG],&outsect[TEXTSG])) if (! follows(&outsect[ROMSG],&outsect[TEXTSG]))
fatal("rom segment must follow text\n") ; fatal("rom segment must follow text\n") ;
if (! follows(&outsect[DATASG],&outsect[ROMSG])) if (! follows(&outsect[DATASG],&outsect[ROMSG]))
fatal("data segment must follow rom\n") ; fatal("data segment must follow rom\n") ;
} }
outsect[TEXTSG].os_size = outsect[ROMSG].os_base - outsect[TEXTSG].os_base;
outsect[ROMSG].os_size = outsect[DATASG].os_base - outsect[ROMSG].os_base;
outsect[DATASG].os_size = outsect[BSSSG].os_base - outsect[DATASG].os_base;
datasize= outsect[DATASG].os_size ;
} }
if (outsect[TEXTSG].os_base == TOT_HDRSIZE+ENTRY) { if (outsect[TEXTSG].os_base == TOT_HDRSIZE+ENTRY) {
if (magic != NMAGIC) { if (magic != NMAGIC) {

View file

@ -159,6 +159,8 @@ main(argc, argv)
datasize= outsect[BSSSG].os_base - outsect[ROMSG].os_base ; datasize= outsect[BSSSG].os_base - outsect[ROMSG].os_base ;
if (! follows(&outsect[DATASG], &outsect[ROMSG])) if (! follows(&outsect[DATASG], &outsect[ROMSG]))
fatal("data segment must follow rom\n") ; fatal("data segment must follow rom\n") ;
outsect[ROMSG].os_size = outsect[DATASG].os_base - outsect[ROMSG].os_base;
outsect[DATASG].os_size = outsect[BSSSG].os_base - outsect[DATASG].os_base;
} else } else
if ( outsect[DATASG].os_lign == 0x20000 ) { if ( outsect[DATASG].os_lign == 0x20000 ) {
/* 410/413 file with ROMSG in instruction space */ /* 410/413 file with ROMSG in instruction space */
@ -166,21 +168,26 @@ main(argc, argv)
magic= NMAGIC ; magic= NMAGIC ;
textsize= (outsect[ROMSG].os_base - outsect[TEXTSG].os_base) + textsize= (outsect[ROMSG].os_base - outsect[TEXTSG].os_base) +
outsect[ROMSG].os_size ; outsect[ROMSG].os_size ;
datasize= outsect[DATASG].os_size ;
if (! follows(&outsect[ROMSG],&outsect[TEXTSG].os_base)) if (! follows(&outsect[ROMSG],&outsect[TEXTSG].os_base))
fatal("rom segment must follow text\n") ; fatal("rom segment must follow text\n") ;
outsect[TEXTSG].os_size = outsect[ROMSG].os_base - outsect[TEXTSG].os_base;
outsect[DATASG].os_size = outsect[BSSSG].os_base - outsect[DATASG].os_base;
datasize= outsect[DATASG].os_size ;
} else { } else {
/* Plain 407 file */ /* Plain 407 file */
rom_in_data = 0; rom_in_data = 0;
magic= OMAGIC ; magic= OMAGIC ;
textsize= (outsect[DATASG].os_base - outsect[TEXTSG].os_base); textsize= (outsect[DATASG].os_base - outsect[TEXTSG].os_base);
datasize= outsect[DATASG].os_size ;
if (!unresolved) { if (!unresolved) {
if (! follows(&outsect[ROMSG],&outsect[TEXTSG])) if (! follows(&outsect[ROMSG],&outsect[TEXTSG]))
fatal("rom segment must follow text\n") ; fatal("rom segment must follow text\n") ;
if (! follows(&outsect[DATASG],&outsect[ROMSG])) if (! follows(&outsect[DATASG],&outsect[ROMSG]))
fatal("data segment must follow rom\n") ; fatal("data segment must follow rom\n") ;
} }
outsect[TEXTSG].os_size = outsect[ROMSG].os_base - outsect[TEXTSG].os_base;
outsect[ROMSG].os_size = outsect[DATASG].os_base - outsect[ROMSG].os_base;
outsect[DATASG].os_size = outsect[BSSSG].os_base - outsect[DATASG].os_base;
datasize= outsect[DATASG].os_size ;
} }
if (outsect[TEXTSG].os_base == TOT_HDRSIZE+ENTRY) { if (outsect[TEXTSG].os_base == TOT_HDRSIZE+ENTRY) {
if (magic != NMAGIC) { if (magic != NMAGIC) {