On Wed, Nov 12, 2014 at 11:04 PM, Izumi Tsutsui <tsut...@ceres.dti.ne.jp> wrote: > christos@ wrote: > >> I grepped -R and used nxr but found nothing. > > Hmm. > http://nxr.netbsd.org/search?q=mkldscript.sh&project=src > shows all files.. > >> >I wonder if you need a different script (or proper wrapper) >> >for modules.. >> >> Well, it did not have a valid syntax also when I tried it for some >> reason (ld complained). It needed: >> >> link_set_foo : { *(link_set_foo) } >> >> instead of: >> >> *(link_set_foo) > > The initial commit message says: > http://mail-index.netbsd.org/source-changes/2004/09/13/msg152610.html > --- > Modified Files: > src/sys/arch/cats/conf: Makefile.cats.inc > src/sys/arch/shark/conf: Makefile.shark.inc > src/sys/conf: Makefile.kern.inc > Added Files: > src/sys/arch/arm/conf: kern.ldscript.head kern.ldscript.tail > mkldscript.sh > > Log Message: > work around a binutils bug where converting ELF kernels to a.out with objcopy > produces corrupted binaries when the link_set_* sections extend into another > page after the end of the .text section by using a generated an ldscript that > puts all the link_set_* data into the .text section in the first place. > --- > > You can see how they can be valid in the Makefiles and > kern.ldscript.{head,tail} files. > > Anyway, it looks required for a.out only but no one will fix > a.out features..
IIUC the requirement for mkldscript.sh users is to merge link_set_* sections. I'll merge link_set_* into .rodata on all ports. Then this hack can go away. (I also found that arm constructor section (.init_array) can't be converted to a.out too.)