system/musl: musl ld.so violates ELF 1.2 specification
Bugzilla ID | 11 |
Reporter | A. Wilcox (awilfox) |
Assignee | A. Wilcox (awilfox) |
Reported | 2016-07-24 18:47:47 -0500 |
Modified | 2017-01-15 11:54:07 -0600 |
Status | IN_PROGRESS |
Version | 1.0-ALPHA1 |
Hardware | Adélie Linux / All |
Importance | Normal / critical |
URL | http://git.musl-libc.org/cgit/musl/tree/ldso/dynlink.c#n1210 |
Description
The ELF 1.2 Specification ( available at https://refspecs.linuxfoundation.org/elf/elf.pdf ), book III, chapter II, section III, subsection VIII, page 2-14 through 2-16 (and Figure 2-10), specifies:
Before the initialization code for any object A is called, the initialization code for any other objects that object A depends on are called. For these purposes, an object A depends on another object B, if B appears in A’s list of needed objects (recorded in the DT_NEEDED entries of the dynamic structure). The order of initialization for circular dependencies is undefined.
Using unpatched musl 1.1.14, 1.1.15, and HEAD, this behaviour is not followed; see https://bpaste.net/raw/89c5111dbc5f for GDB output of a very simple test case using GLib 2.46.2.
This can also affect certain combinations of X.Org drivers and modules unless a module load order is specified by the user in /etc/X11/xorg.conf; specifically, it appears to cause nouveau to fail to start up. It also affects creation of gtk-doc manual sets.
The URL for this bug points to the code that is deficient to the specification.