Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Mar 2017 23:11:56 -0700
From:      Shrikanth Kamath <shrikanth07@gmail.com>
To:        freebsd-hackers@freebsd.org, freebsd-arm@freebsd.org
Subject:   ldscript.arm and elf section ordering
Message-ID:  <CAEOAkMXai0H1nmNxRU=e2KsNaZtEw%2BHK8uAhjZHEu87WXy1KUQ@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAEOAkMXai0H1nmNxRU=e2KsNaZtEw%2BHK8uAhjZHEu87WXy1KUQ>