bfd/
[deliverable/binutils-gdb.git] / ld / ld.texinfo
index d0a5d907bf0dad0b0ef2b4775b9c10cdf4dd7a46..dd3149c8df244dddd3f0529c2c89b0547821673e 100644 (file)
@@ -3410,6 +3410,7 @@ the symbol and place it into the symbol table with a global scope.
 
 @menu
 * Simple Assignments::         Simple Assignments
+* HIDDEN::                     HIDDEN
 * PROVIDE::                    PROVIDE
 * PROVIDE_HIDDEN::             PROVIDE_HIDDEN
 * Source Code Reference::      How to use a linker script defined symbol in source code
@@ -3473,6 +3474,31 @@ the last @samp{.text} input section.  The symbol @samp{_bdata} will be
 defined as the address following the @samp{.text} output section aligned
 upward to a 4 byte boundary.
 
+@node HIDDEN
+@subsection HIDDEN
+@cindex HIDDEN
+For ELF targeted ports, define a symbol that will be hidden and won't be
+exported.  The syntax is @code{HIDDEN(@var{symbol} = @var{expression})}.
+
+Here is the example from @ref{Simple Assignments}, rewritten to use
+@code{HIDDEN}:
+
+@smallexample
+HIDDEN(floating_point = 0);
+SECTIONS
+@{
+  .text :
+    @{
+      *(.text)
+      HIDDEN(_etext = .);
+    @}
+  HIDDEN(_bdata = (. + 3) & ~ 3);
+  .data : @{ *(.data) @}
+@}
+@end smallexample
+@noindent
+In this case none of the three symbols will be visible outside this module.
+
 @node PROVIDE
 @subsection PROVIDE
 @cindex PROVIDE
This page took 0.028644 seconds and 4 git commands to generate.