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]

Adding ELF sections with bfd


Hi,

This is a bit embarrassing, but I am having trouble generating a section, in this case .iplt.

I instigate the creation with a call to bfd_make_section_anyway_with_flags:

      s = bfd_make_section_anyway_with_flags(dynobj, ".iplt",
          flags | SEC_READONLY | SEC_CODE);
      if (s == NULL
          || !bfd_set_section_alignment(dynobj, s, bed->plt_alignment))
        return FALSE;
      htab->root.iplt = s;
      htab->siplt = s;
      htab->iplt_entry_size = 4 * ARRAY_SIZE (mips_exec_iplt_entry);

but later when I want to reference the address of the output section in mips_elf_calculate_relocation(), it doesn't seem to be there. This during bfd_elf_final_link() so I would assume that all the output sections have been allocated by this time.

What is the magic to having a new section get an  output_section allocated to it.

Thanks,
Jack






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