mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-11-04 16:39:24 +01:00 
			
		
		
		
	* generate _GLOBAL_OFFSET_TABLE_ variable on i386 if necessary
git-svn-id: trunk@2124 -
This commit is contained in:
		
							parent
							
								
									06c84e1c5e
								
							
						
					
					
						commit
						43cd438544
					
				@ -850,6 +850,7 @@ implementation
 | 
			
		||||
         pd : tprocdef;
 | 
			
		||||
         unitname8 : string[8];
 | 
			
		||||
         has_impl,ag: boolean;
 | 
			
		||||
         globalvarsym : tglobalvarsym;
 | 
			
		||||
      begin
 | 
			
		||||
         if m_mac in aktmodeswitches then
 | 
			
		||||
           begin
 | 
			
		||||
@ -1027,6 +1028,19 @@ implementation
 | 
			
		||||
         st:=tstaticsymtable.create(current_module.modulename^,current_module.moduleid);
 | 
			
		||||
         current_module.localsymtable:=st;
 | 
			
		||||
 | 
			
		||||
{$ifdef i386}
 | 
			
		||||
         if cs_create_pic in aktmoduleswitches then
 | 
			
		||||
           begin
 | 
			
		||||
             { insert symbol for got access in assembler code}
 | 
			
		||||
             globalvarsym:=tglobalvarsym.create('_GLOBAL_OFFSET_TABLE_',vs_value,voidpointertype,[vo_is_external,vo_is_C_var]);
 | 
			
		||||
             globalvarsym.set_mangledname('_GLOBAL_OFFSET_TABLE_');
 | 
			
		||||
             current_module.localsymtable.insert(globalvarsym);
 | 
			
		||||
             { avoid unnecessary warnings }
 | 
			
		||||
             globalvarsym.varstate:=vs_read;
 | 
			
		||||
             globalvarsym.refs:=1;
 | 
			
		||||
           end;
 | 
			
		||||
{$endif i386}
 | 
			
		||||
 | 
			
		||||
         { Swap the positions of the local and global macro sym table}
 | 
			
		||||
         if assigned(current_module.globalmacrosymtable) then
 | 
			
		||||
           begin
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user