Browse Source

Support .set and .weak in internal assembler.
Fix problem with fpc_initialHeap getting put in .data instead of .bss.

git-svn-id: trunk@30233 -

Jeppe Johansen 10 years ago
parent
commit
155998fe89
2 changed files with 18 additions and 1 deletions
  1. 17 0
      compiler/assemble.pas
  2. 1 1
      compiler/ngenutil.pas

+ 17 - 0
compiler/assemble.pas

@@ -1386,6 +1386,7 @@ Implementation
         leblen : byte;
         lebbuf : array[0..63] of byte;
         objsym,
+        ref,
         objsymend : TObjSymbol;
         zerobuf : array[0..63] of byte;
         relative_reloc: boolean;
@@ -1541,6 +1542,22 @@ Implementation
              ait_cutobject :
                if SmartAsm then
                 break;
+             ait_weak:
+               begin
+                 objsym:=ObjData.symbolref(tai_weak(hp).sym^);
+                 objsym.bind:=AB_WEAK_EXTERNAL;
+               end;
+             ait_set:
+               begin
+                 objsym:=ObjData.symbolref(tai_set(hp).sym^);
+                 ref:=objdata.symbolref(tai_set(hp).value^);
+
+                 objsym.offset:=ref.offset;
+                 objsym.objsection:=ref.objsection;
+{$ifdef arm}
+                 objsym.ThumbFunc:=ref.ThumbFunc;
+{$endif arm}
+               end;
 {$ifndef DISABLE_WIN64_SEH}
              ait_seh_directive :
                tai_seh_directive(hp).generate_code(objdata);

+ 1 - 1
compiler/ngenutil.pas

@@ -975,7 +975,7 @@ implementation
       if target_info.system in systems_embedded then
         begin
           maybe_new_object_file(current_asmdata.asmlists[al_globals]);
-          new_section(current_asmdata.asmlists[al_globals],sec_data,'__fpc_initialheap',current_settings.alignment.varalignmax);
+          new_section(current_asmdata.asmlists[al_globals],sec_bss,'__fpc_initialheap',current_settings.alignment.varalignmax);
           current_asmdata.asmlists[al_globals].concat(tai_datablock.Create_global('__fpc_initialheap',heapsize));
         end;