[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-hackers
Subject:    ldscript.arm and elf section ordering
From:       Shrikanth Kamath <shrikanth07 () gmail ! com>
Date:       2017-03-29 6:11:56
Message-ID: CAEOAkMXai0H1nmNxRU=e2KsNaZtEw+HK8uAhjZHEu87WXy1KUQ () mail ! gmail ! com
[Download RAW message or body]

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
_______________________________________________
freebsd-hackers@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic