This is the mail archive of the 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]

[gold] creating linker generated output section and segment

Hi, I'm working on add a new target to gold linker where the abi
requires the linker to generate a custom section (a custom strtab) and
mapped to a output segment for simulator use. i.e. This section does
not need data from input objects.

I'm current doing this in the target's do_finialize_sections() like this:

 // create custom output section and segment
  Stringpool *mystrtab = new Stringpool();
  mystrtab->add("mystr1", false, NULL);
  mystrtab->add("mystr2", false, NULL);

// using target's do_make_output_section here which simply does new
// as layout's make_output_section is private
  Output_section* mystrtab_os = this->make_output_section(".mystrtab",

  Output_data_strtab* mystrtab_data = new Output_data_strtab(mystrtab);

  //do I need to add the section to section_list and how? Below does not work.

  Output_segment* mystrtab_seg =
    layout->make_output_segment(elfcpp::PT_LOPROC+0x1234, 0);
  mystrtab_seg->add_output_section_to_nonload(mystrtab_os, elfcpp::PF_R);

This is currently not working yet with an runtime assert of Output
section address not valid.
But I want to make sure I'm on the right track first so I want to ask
if this the right way to add linker generated sections and segment?

Any comment appreciated. Thanks!


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