gdb: add target_ops::supports_displaced_step
[deliverable/binutils-gdb.git] / gold / defstd.cc
index 944af3e0869fe0a64375c1911aea644501450e48..fcf46f0876fa5938793525aa68dc5ce6f02afb29 100644 (file)
@@ -1,6 +1,6 @@
 // defstd.cc -- define standard symbols for gold.
 
-// Copyright 2006, 2007 Free Software Foundation, Inc.
+// Copyright (C) 2006-2020 Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <iant@google.com>.
 
 // This file is part of gold.
@@ -23,6 +23,7 @@
 #include "gold.h"
 
 #include "symtab.h"
+#include "layout.h"
 #include "defstd.h"
 
 // This is a simple file which defines the standard symbols like
@@ -106,7 +107,19 @@ const Define_symbol_in_section in_section[] =
     0,                         // nonvis
     true,                      // offset_is_from_end
     true                       // only_if_ref
-  }
+  },
+  {
+    "__stack",                 // name
+    ".stack",                  // output_section
+    0,                         // value
+    0,                         // size
+    elfcpp::STT_NOTYPE,                // type
+    elfcpp::STB_GLOBAL,                // binding
+    elfcpp::STV_DEFAULT,       // visibility
+    0,                         // nonvis
+    false,                     // offset_is_from_end
+    true                       // only_if_ref
+  },
 };
 
 const int in_section_count = sizeof in_section / sizeof in_section[0];
@@ -127,6 +140,20 @@ const Define_symbol_in_segment in_segment[] =
     Symbol::SEGMENT_START,     // offset_from_base
     true                       // only_if_ref
   },
+  {
+    "__ehdr_start",            // name
+    elfcpp::PT_LOAD,           // segment_type
+    elfcpp::PF(0),             // segment_flags_set
+    elfcpp::PF(0),             // segment_flags_clear
+    0,                         // value
+    0,                         // size
+    elfcpp::STT_NOTYPE,                // type
+    elfcpp::STB_GLOBAL,                // binding
+    elfcpp::STV_HIDDEN,                // visibility
+    0,                         // nonvis
+    Symbol::SEGMENT_START,     // offset_from_base
+    true                       // only_if_ref
+  },
   {
     "etext",                   // name
     elfcpp::PT_LOAD,           // segment_type
@@ -237,7 +264,7 @@ const Define_symbol_in_segment in_segment[] =
     elfcpp::STV_DEFAULT,       // visibility
     0,                         // nonvis
     Symbol::SEGMENT_END,       // offset_from_base
-    false                      // only_if_ref
+    true                       // only_if_ref
   }
 };
 
@@ -251,8 +278,11 @@ namespace gold
 void
 define_standard_symbols(Symbol_table* symtab, const Layout* layout)
 {
-  symtab->define_symbols(layout, in_section_count, in_section);
-  symtab->define_symbols(layout, in_segment_count, in_segment);
+  bool saw_sections_clause = layout->script_options()->saw_sections_clause();
+  symtab->define_symbols(layout, in_section_count, in_section,
+                        saw_sections_clause);
+  symtab->define_symbols(layout, in_segment_count, in_segment,
+                        saw_sections_clause);
 }
 
 } // End namespace gold.
This page took 0.02539 seconds and 4 git commands to generate.