os->set_needs_symtab_index();
}
-// An absolute relocation.
+// An absolute or relative relocation.
template<bool dynamic, int size, bool big_endian>
Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>::Output_reloc(
unsigned int type,
Output_data* od,
- Address address)
+ Address address,
+ bool is_relative)
: address_(address), local_sym_index_(0), type_(type),
- is_relative_(false), is_symbolless_(false),
+ is_relative_(is_relative), is_symbolless_(false),
is_section_symbol_(false), use_plt_offset_(false), shndx_(INVALID_CODE)
{
// this->type_ is a bitfield; make sure TYPE fits.
unsigned int type,
Sized_relobj<size, big_endian>* relobj,
unsigned int shndx,
- Address address)
+ Address address,
+ bool is_relative)
: address_(address), local_sym_index_(0), type_(type),
- is_relative_(false), is_symbolless_(false),
+ is_relative_(is_relative), is_symbolless_(false),
is_section_symbol_(false), use_plt_offset_(false), shndx_(shndx)
{
gold_assert(shndx != INVALID_CODE);
// in order to better support gcc, and we need to be compatible.
bool
match_file_name(const char* file_name) const
- { return Layout::match_file_name(this->input_section_.relobj(), file_name); }
+ {
+ if (this->input_section_.is_output_section_data())
+ return false;
+ return Layout::match_file_name(this->input_section_.relobj(), file_name);
+ }
// Returns 1 if THIS should appear before S in section order, -1 if S
// appears before THIS and 0 if they are not comparable.
return s1.index() < s2.index();
}
+ // Some input section names have special ordering requirements.
+ int o1 = Layout::special_ordering_of_input_section(s1.section_name().c_str());
+ int o2 = Layout::special_ordering_of_input_section(s2.section_name().c_str());
+ if (o1 != o2)
+ {
+ if (o1 < 0)
+ return false;
+ else if (o2 < 0)
+ return true;
+ else
+ return o1 < o2;
+ }
+
// A section with a priority follows a section without a priority.
bool s1_has_priority = s1.has_priority();
bool s2_has_priority = s2.has_priority();