tools/buildrom.pm
changeset 57 a44af1db196f
parent 52 8e8f3d664437
equal deleted inserted replaced
56:865fbeda552a 57:a44af1db196f
  1405  			# If the line matches with above syntax, just add the line into oby file.
  1405  			# If the line matches with above syntax, just add the line into oby file.
  1406  			if($new_line !~ /^\s*(\S+)\s+addr\s+(\S+)\s+(\S+)\s+(\S+)\s*$/i)
  1406  			if($new_line !~ /^\s*(\S+)\s+addr\s+(\S+)\s+(\S+)\s+(\S+)\s*$/i)
  1407  			{
  1407  			{
  1408  				if(AddDllDataInfo($new_line))
  1408  				if(AddDllDataInfo($new_line))
  1409  				{
  1409  				{
  1410  					$line = "REM $line";
  1410  					# wasn't a valid line, so comment it out
       
  1411 					$line = "REM $line";
       
  1412  				}
       
  1413  				else
       
  1414  				{
       
  1415  					# valid patchdata command, retain it for final processing (during reformat_line!)
       
  1416  					# In expectation that it will be OK later, emit the "REM processed" marker here
       
  1417  					push @obydata, "REM processed $line";
       
  1418  					push @obydata, reassert_sourceline();
  1411  				}
  1419  				}
  1412  			}
  1420  			}
       
  1421  			push @obydata, "$line";
       
  1422  			next;
  1413 		}
  1423 		}
  1414 
  1424 
  1415 		if($line =~ /^\s*FEATURE\s*(.*)/i || $line =~ /^\s*EXCLUDE_FEATURE\s*(.*)/i)
  1425 		if($line =~ /^\s*FEATURE\s*(.*)/i || $line =~ /^\s*EXCLUDE_FEATURE\s*(.*)/i)
  1416 		{
  1426 		{
  1417 			# Process the feature keywords only when "-f|fr" or "-fm" is passed to buildrom
  1427 			# Process the feature keywords only when "-f|fr" or "-fm" is passed to buildrom
  3446 		my $value = $4;
  3456 		my $value = $4;
  3447 		my ($index, $elementSize);		# For when the symbol is an array, and we're patching one element
  3457 		my ($index, $elementSize);		# For when the symbol is an array, and we're patching one element
  3448 		my $scalarSize;
  3458 		my $scalarSize;
  3449 		
  3459 		
  3450 		if(!defined $DllDataMap{$patchdlldatamap_key}->{dstpath}){
  3460 		if(!defined $DllDataMap{$patchdlldatamap_key}->{dstpath}){
  3451 			print_source_error(" File $romfilename has not been included into ROM image");
  3461 			print_source_error(" Bad patchdata statement: $romfilename has not been included into ROM image");
  3452 			$errors++ if($strict);
  3462 			$errors++ if($strict);
  3453 			$line = "REM $line\n";
  3463 			$line = "REM $line\n";
  3454 			return $line;
  3464 			return $line;
  3455 		}
  3465 		}
  3456 	
  3466 	
  4420 		}
  4430 		}
  4421 		elsif($intVal =~ /^(-\d+)$/ or $intVal =~ /^(\d+)$/){		
  4431 		elsif($intVal =~ /^(-\d+)$/ or $intVal =~ /^(\d+)$/){		
  4422 			$newVal = $1;
  4432 			$newVal = $1;
  4423 		}
  4433 		}
  4424 		else{
  4434 		else{
  4425  			print "ERROR: Invalid patchable value at \"$line\"\n";
  4435  			print_source_error("ERROR: Invalid patchable value : $line");
  4426  			$errors++ if($strict);
  4436  			$errors++ if($strict);
  4427  			return 1;
  4437  			return 1;
  4428 		}
  4438 		}
  4429 		$symbolname =~ s/:(\d+)\[(0x)?[0-9a-f]+\]$//i;	# Remove array element specification (:ELEMENT_BIT_SIZE[INDEX]) to get symbol name
  4439 		$symbolname =~ s/:(\d+)\[(0x)?[0-9a-f]+\]$//i;	# Remove array element specification (:ELEMENT_BIT_SIZE[INDEX]) to get symbol name
  4430 
  4440