// defstd.cc -- define standard symbols for gold.
-// Copyright 2006, 2007 Free Software Foundation, Inc.
+// Copyright (C) 2006-2018 Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
// This file is part of gold.
#include "gold.h"
#include "symtab.h"
+#include "layout.h"
#include "defstd.h"
// This is a simple file which defines the standard symbols like
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];
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
elfcpp::STV_DEFAULT, // visibility
0, // nonvis
Symbol::SEGMENT_END, // offset_from_base
- false // only_if_ref
+ true // only_if_ref
}
};
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.