DragonFly added support for ELF preinit, init, and fini arrays

John Marino draco at marino.st
Sun Feb 19 08:03:00 UTC 2012


On 2/18/2012 10:38 PM, Konstantin Belousov wrote:
>
> Thank you, it was very useful. It seems that test4 needed some adjustments
> to actually provide the required dso for tests.
Yeah.  I thought I gave you a version that worked out of the box but I 
did modify this test as well.

> Now, the patch at http://people.freebsd.org/~kib/misc/init_array.2.patch
> passes your tests and allows to boot world built with pre-patched csu
> into multiuser mode.
>
> I decided to move the calls to initializers for main binary into rtld,
> and used the brand note to distinguish old and new csu.
I assume the purpose of this is to have a clean split with static 
initialization done in crt1 and dynamic initialization done entirely in 
rtld for binaries built with version 100009 and later.  Does the note 
digestion used to check osrel add significant overhead?

Is not this information already available via aux_vectors passed on from 
imgact_elf.c?

>
> ATM patch is only for i386 and amd64, I will port to other architectures
> after some feedback.
It's out of scope of your current work but related to notes, but there's 
another test that DragonFly passes that FreeBSD fails.  If memory 
serves, it was caused by the PT_NOTE segment getting located outside of 
the first page the majority of the time starting with binutils 2.21.
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/9d35f29fb5dd669d4e04521b39296e5bdf14b2b0

A related problem was an interpret segment outside of the first page:
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/99aed3e43ef052664173110d6db3ddf6a62e375b

Both of these were handled within sys/kern/imgact_elf.c

John





More information about the freebsd-toolchain mailing list