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;
 | 
					         pd : tprocdef;
 | 
				
			||||||
         unitname8 : string[8];
 | 
					         unitname8 : string[8];
 | 
				
			||||||
         has_impl,ag: boolean;
 | 
					         has_impl,ag: boolean;
 | 
				
			||||||
 | 
					         globalvarsym : tglobalvarsym;
 | 
				
			||||||
      begin
 | 
					      begin
 | 
				
			||||||
         if m_mac in aktmodeswitches then
 | 
					         if m_mac in aktmodeswitches then
 | 
				
			||||||
           begin
 | 
					           begin
 | 
				
			||||||
@ -1027,6 +1028,19 @@ implementation
 | 
				
			|||||||
         st:=tstaticsymtable.create(current_module.modulename^,current_module.moduleid);
 | 
					         st:=tstaticsymtable.create(current_module.modulename^,current_module.moduleid);
 | 
				
			||||||
         current_module.localsymtable:=st;
 | 
					         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}
 | 
					         { Swap the positions of the local and global macro sym table}
 | 
				
			||||||
         if assigned(current_module.globalmacrosymtable) then
 | 
					         if assigned(current_module.globalmacrosymtable) then
 | 
				
			||||||
           begin
 | 
					           begin
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user