Browse Source

Add implementation and documentation of special __ld_bss_even_end symbol, resolved to the first even address after the end of the BSS section.
Code by PpHd.

git-svn-id: file:///var/svn/tigccpp/trunk@1272 9552661e-59e3-4036-b4f2-dbe53926924f

debrouxl 15 years ago
parent
commit
cc19164616

File diff suppressed because it is too large
+ 0 - 0
tigcc/doc/System/Info/ld/symbols.hss


+ 1 - 1
tigcc/doc/System/Info/ld/symbols_ld_bss_end.hss

@@ -1,6 +1,6 @@
 [Main]
 Title=__ld_bss_end
-See Also=symbols_ld_bss_start: __ld_bss_start, symbols_ld_bss_size: __ld_bss_size
+See Also=symbols_ld_bss_start: __ld_bss_start, symbols_ld_bss_size: __ld_bss_size, symbols_ld_bss_even_end: __ld_bss_even_end
 
 [Top]
 This built-in symbol represents the end of the BSS section. It points to the

+ 10 - 0
tigcc/doc/System/Info/ld/symbols_ld_bss_even_end.hss

@@ -0,0 +1,10 @@
+[Main]
+Title=__ld_bss_even_end
+See Also=symbols_ld_bss_end: __ld_bss_end, symbols_ld_bss_start: __ld_bss_start, symbols_ld_bss_size: __ld_bss_size
+
+[Top]
+This built-in symbol points to the first even location behind the last item
+in the BSS section. In other words, it is equal to
+<A HREF="$$LINK(symbols_ld_bss_end)">__ld_bss_end</A>
+rounded up to the next multiple of 2.
+If the program does not contain a BSS section, an error is reported.

+ 1 - 1
tigcc/doc/System/Info/ld/symbols_ld_bss_size.hss

@@ -1,6 +1,6 @@
 [Main]
 Title=__ld_bss_size
-See Also=symbols_ld_bss_start: __ld_bss_start, symbols_ld_bss_end: __ld_bss_end
+See Also=symbols_ld_bss_start: __ld_bss_start, symbols_ld_bss_end: __ld_bss_end, symbols_ld_bss_even_end: __ld_bss_even_end
 
 [Top]
 This built-in symbol represents the size of the BSS section in bytes. If the

+ 1 - 1
tigcc/doc/System/Info/ld/symbols_ld_bss_start.hss

@@ -1,6 +1,6 @@
 [Main]
 Title=__ld_bss_start
-See Also=symbols_ld_bss_end: __ld_bss_end, symbols_ld_bss_size: __ld_bss_size
+See Also=symbols_ld_bss_end: __ld_bss_end, symbols_ld_bss_even_end: __ld_bss_even_end, symbols_ld_bss_size: __ld_bss_size
 
 [Top]
 This built-in symbol represents the starting address of the BSS section. If

+ 10 - 0
tigcc/ld-tigcc/special.c

@@ -739,6 +739,16 @@ BOOLEAN ResolveSpecialSymbolLocation (SECTION *Section, LOCATION *Location, BOOL
 				else
 					return TRUE;
 			}
+			else if (SymNameMatches ("bss_even_end"))
+			{
+				if (Program->BSSSection)
+				{
+					NewSymbol = Program->BSSSection->SectionSymbol;
+					NewTargetOffset = (OFFSET) ((unsigned long) (Program->BSSSection->Size + 1) & ~1UL);
+				}
+				else
+					return TRUE;
+			}
 			else if (SymNameMatches ("bss_size"))
 			{
 				if (Program->BSSSection)

Some files were not shown because too many files changed in this diff