This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Adding ELF sections with bfd
- From: Jack Carter <Jack dot Carter at imgtec dot com>
- To: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Tue, 25 Jun 2013 00:43:33 +0000
- Subject: 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