This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [nonworking patch] gold/arm: define $a/$d markers in .plt


> I tried this, to no avail (the symbols don't appear in the output at all).
> Patch below for reference.

I think your patch is pretty close to working. The problem is that
Symbol_table::sized_write_globals() only visits symbols in the global
symbol table, so it never sees the ones in forced_locals_ that weren't
also added to the global table. I think you need a separate
generated_locals_ list, change Symbol_table::sized_finalize() to
iterate over that list the same way it does over forced_locals_, and
add a loop to Symbol_table::sized_write_globals() to iterate over the
generated_locals_ list to write them out.

+template<int size>
+Sized_symbol<size>*
+Symbol_table::do_define_local_in_output_data(
+    const char* name, Defined defined, Output_data* od,
+    typename elfcpp::Elf_types<size>::Elf_Addr value,
+    typename elfcpp::Elf_types<size>::Elf_WXword symsize,
+    elfcpp::STT type, bool offset_is_from_end)
+{
+  Sized_symbol<size>* sym = new Sized_symbol<size>();

You should probably check for target.has_make_symbol(), like this:

  const Target& target = parameters->target();
  if (!target.has_make_symbol())
    sym = new Sized_symbol<size>();
  else
    {
      Sized_target<size, big_endian>* sized_target =
	parameters->sized_target<size, big_endian>();
      sym = sized_target->make_symbol();
      if (sym == NULL)
        return NULL;
    }

-cary


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]