ldscript.arm and elf section ordering
Shrikanth Kamath
shrikanth07 at gmail.com
Wed Mar 29 06:11:58 UTC 2017
Have a question around the order in which symtab/strtab/shstrtab are
placed for the elf binaries. Working with two different versions of
the LLVM toolchain here in Juniper, so when building FreeBSD kernel
with llvm 3.5 toolchain for arm (toolchain is published from sources
internally) the sections shstrtab/symtab/strtab have offsets that are
in increasing order (this is skimmed output from readelf)
[Nr] Name Type Addr Off Size
ES Flg Lk Inf Al
...
[44] .shstrtab STRTAB 00000000 ede7f2 000283 00 0 0 1
[45] .symtab SYMTAB 00000000 edf1d0 05fc40 10 46 15427 4
[46] .strtab STRTAB 00000000 f3ee10 0834a2 00 0 0 1
When building with llvm 3.7 though the offsets do not appear to be in
the expected order
[40] .shstrtab STRTAB 00000000 10cbdaa 000229 00 0 0 1
[41] .symtab SYMTAB 00000000 fd0520 079de0 10
42 22109 4
[42] .strtab STRTAB 00000000 104a300 081aaa 00
0 0 1
the .shstrtab offset appears to be beyond section ".strtab" and
".symtab" but in terms of section ordering .shstrtab appears before
symtab and strtab. Due to some design constraint I need to investigate
if we can fix the .shstrtab beyond .symtab and .strtab, query to
hackers is if this is an advisable thing to do? And how should the
ldscript.arm be used to reorder this.
Thanks,
--
Shrikanth R K
More information about the freebsd-arm
mailing list