[Bug 199943] document guarantee provided by dl_iterate_phdr(3) callback order

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue May 5 02:13:33 UTC 2015


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199943

            Bug ID: 199943
           Summary: document guarantee provided by dl_iterate_phdr(3)
                    callback order
           Product: Base System
           Version: 11.0-CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: misc
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: emaste at freebsd.org

A number of posts found on e.g. http://stackoverflow.com/ and elsewhere ask
about the order of objects returned by dl_iterate_phdr. Those questions are
typically targeted at Linux, but the question is equally applicable to FreeBSD.
The question usually arises from a desire to know which is the main executable.

In practice the executable is passed to the first callback invocation, but
there is currently no guarantee that this will not change.  We should choose
one of:

1) Document this and add a test so that it remains the case
2) Caution that the order of objects is not guaranteed, and consumers should
not rely on a particular order

Equivalent issue for Linux (but probably not in the correct bug tracker):
https://bugzilla.kernel.org/show_bug.cgi?id=94141

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list