More than 65536 sections in an ELF file
H.J. Lu
hjl.tools@gmail.com
Sat Mar 8 01:21:00 GMT 2008
Hi Ian,
On Fri, Mar 7, 2008 at 4:18 PM, Ian Lance Taylor <iant@google.com> wrote:
> It seems to me that the support in BFD for ELF files with more than
> 65536 sections is at least partially wrong. This code in
> assign_section_numbers
>
> if (section_number == SHN_LORESERVE)
> section_number += SHN_HIRESERVE + 1 - SHN_LORESERVE;
>
> causes a range of section numbers to be skipped. The effect is that
> any links to sections with an index larger than SHN_LORESERVE are
> incremented. This is effectively undone in elf_object_p in elfcode.h,
> which skips that range when building an array.
>
> I just built an ELF object file with 70010 sections. As usual, the
> section string table is near the end of the sections, which means
> that its index is greater than SHN_LORESERVE == 0xff00.
>
Icc has generated files with more than 65536 sections. I am not aware of any
problem. Can you open a bug report with a script to generate a file with more
than 65536 sections and show the problem with readelf?
Thanks.
H.J.
More information about the Binutils
mailing list