// object.cc -- support for an object file for linking in gold
-// Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012
+// Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
// Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
}
}
+// Get the address of an output section.
+
+template<int size, bool big_endian>
+uint64_t
+Sized_relobj<size, big_endian>::do_output_section_address(
+ unsigned int shndx)
+{
+ // If the input file is linked as --just-symbols, the output
+ // section address is the input section address.
+ if (this->just_symbols())
+ return this->section_address(shndx);
+
+ const Output_section* os = this->do_output_section(shndx);
+ gold_assert(os != NULL);
+ return os->address();
+}
+
// Class Sized_relobj_file.
template<int size, bool big_endian>
if (!is_pass_two)
layout->layout_gnu_stack(seen_gnu_stack, gnu_stack_flags, this);
+ // Handle the .eh_frame sections after the other sections.
+ gold_assert(!is_pass_one || eh_frame_sections.empty());
+ for (std::vector<unsigned int>::const_iterator p = eh_frame_sections.begin();
+ p != eh_frame_sections.end();
+ ++p)
+ {
+ unsigned int i = *p;
+ const unsigned char* pshdr;
+ pshdr = section_headers_data + i * This::shdr_size;
+ typename This::Shdr shdr(pshdr);
+
+ this->layout_eh_frame_section(layout,
+ symbols_data,
+ symbols_size,
+ symbol_names_data,
+ symbol_names_size,
+ i,
+ shdr,
+ reloc_shndx[i],
+ reloc_type[i]);
+ }
+
// When doing a relocatable link handle the reloc sections at the
// end. Garbage collection and Identical Code Folding is not
// turned on for relocatable code.
out_section_offsets[i] = invalid_address;
}
- // Handle the .eh_frame sections at the end.
- gold_assert(!is_pass_one || eh_frame_sections.empty());
- for (std::vector<unsigned int>::const_iterator p = eh_frame_sections.begin();
- p != eh_frame_sections.end();
- ++p)
- {
- unsigned int i = *p;
- const unsigned char* pshdr;
- pshdr = section_headers_data + i * This::shdr_size;
- typename This::Shdr shdr(pshdr);
-
- this->layout_eh_frame_section(layout,
- symbols_data,
- symbols_size,
- symbol_names_data,
- symbol_names_size,
- i,
- shdr,
- reloc_shndx[i],
- reloc_type[i]);
- }
-
// When building a .gdb_index section, scan the .debug_info and
// .debug_types sections.
gold_assert(!is_pass_one
&& (static_cast<off_t>(sym.get_st_value() + sym.get_st_size())
> offset))
{
+ info->enclosing_symbol_type = sym.get_st_type();
if (sym.get_st_name() > names_size)
info->enclosing_symbol_name = "(invalid)";
else
ret += ":";
ret += info.source_file;
}
- size_t len = info.enclosing_symbol_name.length() + 100;
- char* buf = new char[len];
- snprintf(buf, len, _(":function %s"),
- info.enclosing_symbol_name.c_str());
- ret += buf;
- delete[] buf;
+ ret += ":";
+ if (info.enclosing_symbol_type == elfcpp::STT_FUNC)
+ ret += _("function ");
+ ret += info.enclosing_symbol_name;
return ret;
}
#endif
#ifdef HAVE_TARGET_32_LITTLE
+template
+class Sized_relobj<32, false>;
+
template
class Sized_relobj_file<32, false>;
#endif
#ifdef HAVE_TARGET_32_BIG
+template
+class Sized_relobj<32, true>;
+
template
class Sized_relobj_file<32, true>;
#endif
#ifdef HAVE_TARGET_64_LITTLE
+template
+class Sized_relobj<64, false>;
+
template
class Sized_relobj_file<64, false>;
#endif
#ifdef HAVE_TARGET_64_BIG
+template
+class Sized_relobj<64, true>;
+
template
class Sized_relobj_file<64, true>;
#endif