|
Message-ID: <20220411145802.GQ7074@brightrain.aerifal.cx> Date: Mon, 11 Apr 2022 10:58:02 -0400 From: Rich Felker <dalias@...c.org> To: Jeffrey Walton <noloader@...il.com> Cc: musl@...ts.openwall.com, Colin Cross <ccross@...gle.com> Subject: Re: [PATCH] dl_iterate_phdr: return empty string for the name of the main program On Mon, Apr 11, 2022 at 10:03:47AM -0400, Jeffrey Walton wrote: > On Mon, Apr 11, 2022 at 8:42 AM Rich Felker <dalias@...c.org> wrote: > > > > On Mon, Apr 11, 2022 at 08:24:21AM -0400, Jeffrey Walton wrote: > > > On Mon, Apr 4, 2022 at 11:57 PM Michael Forney <mforney@...rney.org> wrote: > > > > > > > > ... > > > > > Use a constant empty string instead of the DSO name field for the first > > > > > entry in the DSO list. > > > > > > > > I believe glibc is the exception here, not musl. When I looked at > > > > this, every other operating system I tried used the program name for > > > > the first object. > > > > > > I may be splitting hairs, but the dl_iterate_phdr(3) man page does not > > > say a program is returned during the enumeration. It says shared > > > objects are returned. > > > > You are. The intent, actual practice -- and absolute necessity for > > this function to serve its purpose, which includes admiting the > > implementation of exception handling -- is that it be included. And in > > this context, the (dynamic linked) program *is* a shared object. > > I think you are conflating ET_DYN with a shared object. The presence > of ET_DYN does not make a program a shared object, it merely means the > object is relocatable (i.e., position independent code). No, I'm not. What makes it a shared object is that it's one of the objects processed by the dynamic linker with a _DYNAMIC object, dynamic symbol table, dynamic relocation section, etc. whose symbols are shared with other shared objects at runtime. Rich
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.