Adding ELF sections with bfd
Jack Carter
Jack.Carter@imgtec.com
Tue Jun 25 00:44:00 GMT 2013
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
More information about the Binutils
mailing list