// object.cc -- support for an object file for linking in gold
-// Copyright 2006, 2007 Free Software Foundation, Inc.
+// Copyright 2006, 2007, 2008 Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
// This file is part of gold.
{
return (shdr->get_sh_size() > 0
&& shdr->get_sh_type() == elfcpp::SHT_PROGBITS
- && shdr->get_sh_flags() == elfcpp::SHF_ALLOC);
+ && (shdr->get_sh_flags() & elfcpp::SHF_ALLOC) != 0);
}
// Return whether there is a GNU .eh_frame section, given the section
const unsigned char* namesu = sd->section_names->data();
const char* names = reinterpret_cast<const char*>(namesu);
- if (this->find_eh_frame(pshdrs, names, sd->section_names_size))
- this->has_eh_frame_ = true;
+ if (memmem(names, sd->section_names_size, ".eh_frame", 10) != NULL)
+ {
+ if (this->find_eh_frame(pshdrs, names, sd->section_names_size))
+ this->has_eh_frame_ = true;
+ }
sd->symbols = NULL;
sd->symbols_size = 0;
if (shndx >= elfcpp::SHN_LORESERVE)
{
- if (shndx == elfcpp::SHN_ABS)
+ if (shndx == elfcpp::SHN_ABS || shndx == elfcpp::SHN_COMMON)
lv.set_output_value(lv.input_value());
else
{
return this->output_local_dynsym_count_;
}
-// Return the value of the local symbol symndx.
-template<int size, bool big_endian>
-typename elfcpp::Elf_types<size>::Elf_Addr
-Sized_relobj<size, big_endian>::local_symbol_value(unsigned int symndx) const
-{
- gold_assert(symndx < this->local_symbol_count_);
- gold_assert(symndx < this->local_values_.size());
- const Symbol_value<size>& lv(this->local_values_[symndx]);
- return lv.value(this, 0);
-}
-
// Write out the local symbols.
template<int size, bool big_endian>