Linux Manual Pages development
 help / color / mirror / Atom feed
* [PATCH v2] dlinfo.3: Document the RTLD_DI_PHDR request
@ 2024-08-28 11:01 Florian Weimer
  2024-08-28 11:45 ` Alejandro Colomar
  0 siblings, 1 reply; 4+ messages in thread
From: Florian Weimer @ 2024-08-28 11:01 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: linux-man, libc-alpha

First added in glibc 2.36, backported upstream to glibc 2.34,
so mention 2.34.1 for the first version.

Signed-off-by: Florian Weimer <fweimer@redhat.com>

---
v2: Fix commit IDs.
 man/man3/dlinfo.3 | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/man/man3/dlinfo.3 b/man/man3/dlinfo.3
index 84b696f8c..8158356bd 100644
--- a/man/man3/dlinfo.3
+++ b/man/man3/dlinfo.3
@@ -194,10 +194,23 @@ If this object does not define a PT_TLS segment,
 or if the calling thread has not allocated a block for it,
 NULL is placed in
 .IR *info .
+.TP
+.BR RTLD_DI_PHDR " (\fIconst ElfW(Phdr *)\fP, since glibc 2.34.1)"
+.\" glibc commit d056c212130280c0a54d9a4f72170ec621b70ce5 (2.36)
+.\" glibc commit 28ea43f8d64f0dd1f2de75525157730e1532e600 (2.35.1)
+.\" glibc commit 91c2e6c3db44297bf4cb3a2e3c40236c5b6a0b23 (2.34.1)
+Obtain the address of this shared object's program header and place it
+in
+.IR *info .
+This
+.B dlinfo
+call returns the number of program headers in the shared object.
 .SH RETURN VALUE
 On success,
 .BR dlinfo ()
-returns 0.
+returns 0
+(if not specified explicitly),
+or a positive value corresponding to the request.
 On failure, it returns \-1; the error can be diagnosed using
 .BR dlerror (3).
 .SH ATTRIBUTES

base-commit: 6a7f1461b0e5474d50ef1920558dec103c0c058f


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] dlinfo.3: Document the RTLD_DI_PHDR request
  2024-08-28 11:01 [PATCH v2] dlinfo.3: Document the RTLD_DI_PHDR request Florian Weimer
@ 2024-08-28 11:45 ` Alejandro Colomar
  2024-08-28 11:50   ` Florian Weimer
  0 siblings, 1 reply; 4+ messages in thread
From: Alejandro Colomar @ 2024-08-28 11:45 UTC (permalink / raw)
  To: Florian Weimer; +Cc: linux-man, libc-alpha

[-- Attachment #1: Type: text/plain, Size: 1674 bytes --]

Hi Florian,

On Wed, Aug 28, 2024 at 01:01:56PM GMT, Florian Weimer wrote:
> First added in glibc 2.36, backported upstream to glibc 2.34,
> so mention 2.34.1 for the first version.
> 
> Signed-off-by: Florian Weimer <fweimer@redhat.com>
> 
> ---
> v2: Fix commit IDs.
>  man/man3/dlinfo.3 | 15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/man/man3/dlinfo.3 b/man/man3/dlinfo.3
> index 84b696f8c..8158356bd 100644
> --- a/man/man3/dlinfo.3
> +++ b/man/man3/dlinfo.3
> @@ -194,10 +194,23 @@ If this object does not define a PT_TLS segment,
>  or if the calling thread has not allocated a block for it,
>  NULL is placed in
>  .IR *info .
> +.TP
> +.BR RTLD_DI_PHDR " (\fIconst ElfW(Phdr *)\fP, since glibc 2.34.1)"
> +.\" glibc commit d056c212130280c0a54d9a4f72170ec621b70ce5 (2.36)
> +.\" glibc commit 28ea43f8d64f0dd1f2de75525157730e1532e600 (2.35.1)
> +.\" glibc commit 91c2e6c3db44297bf4cb3a2e3c40236c5b6a0b23 (2.34.1)
> +Obtain the address of this shared object's program header and place it
> +in
> +.IR *info .
> +This
> +.B dlinfo
> +call returns the number of program headers in the shared object.

Can that number be 0?

>  .SH RETURN VALUE
>  On success,
>  .BR dlinfo ()
> -returns 0.
> +returns 0
> +(if not specified explicitly),
> +or a positive value corresponding to the request.

If so, this should be nonnegative rather than positive.

Cheers,
Alex

>  On failure, it returns \-1; the error can be diagnosed using
>  .BR dlerror (3).
>  .SH ATTRIBUTES
> 
> base-commit: 6a7f1461b0e5474d50ef1920558dec103c0c058f
> 
> 

-- 
<https://www.alejandro-colomar.es/>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] dlinfo.3: Document the RTLD_DI_PHDR request
  2024-08-28 11:45 ` Alejandro Colomar
@ 2024-08-28 11:50   ` Florian Weimer
  2024-08-28 12:34     ` Alejandro Colomar
  0 siblings, 1 reply; 4+ messages in thread
From: Florian Weimer @ 2024-08-28 11:50 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: linux-man, libc-alpha

* Alejandro Colomar:

> Hi Florian,
>
> On Wed, Aug 28, 2024 at 01:01:56PM GMT, Florian Weimer wrote:
>> First added in glibc 2.36, backported upstream to glibc 2.34,
>> so mention 2.34.1 for the first version.
>> 
>> Signed-off-by: Florian Weimer <fweimer@redhat.com>
>> 
>> ---
>> v2: Fix commit IDs.
>>  man/man3/dlinfo.3 | 15 ++++++++++++++-
>>  1 file changed, 14 insertions(+), 1 deletion(-)
>> 
>> diff --git a/man/man3/dlinfo.3 b/man/man3/dlinfo.3
>> index 84b696f8c..8158356bd 100644
>> --- a/man/man3/dlinfo.3
>> +++ b/man/man3/dlinfo.3
>> @@ -194,10 +194,23 @@ If this object does not define a PT_TLS segment,
>>  or if the calling thread has not allocated a block for it,
>>  NULL is placed in
>>  .IR *info .
>> +.TP
>> +.BR RTLD_DI_PHDR " (\fIconst ElfW(Phdr *)\fP, since glibc 2.34.1)"
>> +.\" glibc commit d056c212130280c0a54d9a4f72170ec621b70ce5 (2.36)
>> +.\" glibc commit 28ea43f8d64f0dd1f2de75525157730e1532e600 (2.35.1)
>> +.\" glibc commit 91c2e6c3db44297bf4cb3a2e3c40236c5b6a0b23 (2.34.1)
>> +Obtain the address of this shared object's program header and place it
>> +in
>> +.IR *info .
>> +This
>> +.B dlinfo
>> +call returns the number of program headers in the shared object.
>
> Can that number be 0?

No, there has to be at least one PT_LOAD segment.

Thanks,
Florian


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] dlinfo.3: Document the RTLD_DI_PHDR request
  2024-08-28 11:50   ` Florian Weimer
@ 2024-08-28 12:34     ` Alejandro Colomar
  0 siblings, 0 replies; 4+ messages in thread
From: Alejandro Colomar @ 2024-08-28 12:34 UTC (permalink / raw)
  To: Florian Weimer; +Cc: linux-man, libc-alpha

[-- Attachment #1: Type: text/plain, Size: 1600 bytes --]

Hi Florian,

On Wed, Aug 28, 2024 at 01:50:23PM GMT, Florian Weimer wrote:
> * Alejandro Colomar:
> 
> > Hi Florian,
> >
> > On Wed, Aug 28, 2024 at 01:01:56PM GMT, Florian Weimer wrote:
> >> First added in glibc 2.36, backported upstream to glibc 2.34,
> >> so mention 2.34.1 for the first version.
> >> 
> >> Signed-off-by: Florian Weimer <fweimer@redhat.com>
> >> 
> >> ---
> >> v2: Fix commit IDs.
> >>  man/man3/dlinfo.3 | 15 ++++++++++++++-
> >>  1 file changed, 14 insertions(+), 1 deletion(-)
> >> 
> >> diff --git a/man/man3/dlinfo.3 b/man/man3/dlinfo.3
> >> index 84b696f8c..8158356bd 100644
> >> --- a/man/man3/dlinfo.3
> >> +++ b/man/man3/dlinfo.3
> >> @@ -194,10 +194,23 @@ If this object does not define a PT_TLS segment,
> >>  or if the calling thread has not allocated a block for it,
> >>  NULL is placed in
> >>  .IR *info .
> >> +.TP
> >> +.BR RTLD_DI_PHDR " (\fIconst ElfW(Phdr *)\fP, since glibc 2.34.1)"
> >> +.\" glibc commit d056c212130280c0a54d9a4f72170ec621b70ce5 (2.36)
> >> +.\" glibc commit 28ea43f8d64f0dd1f2de75525157730e1532e600 (2.35.1)
> >> +.\" glibc commit 91c2e6c3db44297bf4cb3a2e3c40236c5b6a0b23 (2.34.1)
> >> +Obtain the address of this shared object's program header and place it
> >> +in
> >> +.IR *info .
> >> +This
> >> +.B dlinfo
> >> +call returns the number of program headers in the shared object.
> >
> > Can that number be 0?
> 
> No, there has to be at least one PT_LOAD segment.

Thanks!  I've applied the patch.

Cheers,
Alex

> 
> Thanks,
> Florian
> 

-- 
<https://www.alejandro-colomar.es/>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-08-28 12:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-28 11:01 [PATCH v2] dlinfo.3: Document the RTLD_DI_PHDR request Florian Weimer
2024-08-28 11:45 ` Alejandro Colomar
2024-08-28 11:50   ` Florian Weimer
2024-08-28 12:34     ` Alejandro Colomar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox