mirror of
				https://git.proxmox.com/git/mirror_edk2
				synced 2025-10-31 01:16:21 +00:00 
			
		
		
		
	 878b807a43
			
		
	
	
		878b807a43
		
	
	
	
	
		
			
			https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
		
			
				
	
	
		
			65 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			65 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| ;
 | |
| ; Copyright (c) 2011, Hewlett-Packard Company. All rights reserved.<BR>
 | |
| ; 
 | |
| ; SPDX-License-Identifier: BSD-2-Clause-Patent
 | |
| ; 
 | |
| 
 | |
|   LOCAL &imgstart &strippedsize &debugdirentryrva &debugtype &debugrva &dwarfsig &elfbase &elfpath &pathoffset
 | |
|   ENTRY &imgstart
 | |
|   
 | |
|   &imgstart=&imgstart
 | |
|   print "TE image found at &imgstart"
 | |
| 
 | |
|   ; determine pe header bytes removed to account for in rva references
 | |
|   &strippedsize=(Data.Long(a:&imgstart+0x4)&0xffff0000)>>16.
 | |
|   &strippedsize=&strippedsize-0x28
 | |
| 
 | |
|   &debugdirentryrva=Data.Long(a:&imgstart+0x20)
 | |
|   if &debugdirentryrva==0
 | |
|   (
 | |
|     print "no debug dir for image at &imgstart"
 | |
|     enddo
 | |
|   )
 | |
|   &debugdirentryrva=&debugdirentryrva-&strippedsize
 | |
| 
 | |
|   &debugtype=Data.Long(a:&imgstart+&debugdirentryrva+0xc)
 | |
|   if (&debugtype!=0xdf)&&(&debugtype!=0x02)
 | |
|   (
 | |
|     print "debug type is not dwarf for image at &imgstart, it's &debugtype"
 | |
|     enddo
 | |
|   )
 | |
|   
 | |
|   &debugrva=Data.Long(a:&imgstart+&debugdirentryrva+0x14)
 | |
|   &debugrva=&debugrva-&strippedsize;
 | |
|   &dwarfsig=Data.Long(a:&imgstart+&debugrva);
 | |
|   if &dwarfsig==0x66727764
 | |
|   (
 | |
|     &pathoffset=0xc
 | |
|   )
 | |
|   else
 | |
|   (
 | |
|     if &dwarfsig==0x3031424E
 | |
|     (
 | |
|       &pathoffset=0x10
 | |
|     )
 | |
|     else
 | |
|     (
 | |
|       print "debug signature not found for image at &imgstart, its &dwarfsig"
 | |
|       enddo
 | |
|     )
 | |
|   )
 | |
| 
 | |
|   &elfpath=Data.String(c:&imgstart+&debugrva+&pathoffset)
 | |
| 
 | |
|   ; elf base is baseofcode (we hope that for TE images it's not baseofdata)
 | |
|   &elfbase=&imgstart+Data.Long(a:&imgstart+0xc)-&strippedsize
 | |
| 
 | |
|   print "found path &elfpath"
 | |
|   ; $fprintf 50, "load /ni /np /a %s &0x%x\n",elfpath,elfbase$;
 | |
|          ON ERROR GOSUB
 | |
|               return
 | |
|   data.load.elf &elfpath &elfbase /NOCODE /NOCLEAR
 | |
|         ON error
 | |
| 
 | |
| enddo
 |