From cb32f86c1d2e4b4670ce827e015a3599759d8943 Mon Sep 17 00:00:00 2001 From: Joseph Koshy Date: Sun, 21 Oct 2007 05:15:07 +0000 Subject: [PATCH] Remove references to the 'e_phnum' field of the ELF header. Instead, point the reader to the elf_getphnum() function. MFC after: 1 day --- lib/libelf/gelf_getphdr.3 | 12 ++++++------ lib/libelf/gelf_newphdr.3 | 11 +++-------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/lib/libelf/gelf_getphdr.3 b/lib/libelf/gelf_getphdr.3 index 51d20a009c99..d6ffb9061477 100644 --- a/lib/libelf/gelf_getphdr.3 +++ b/lib/libelf/gelf_getphdr.3 @@ -1,4 +1,4 @@ -.\" Copyright (c) 2006 Joseph Koshy. All rights reserved. +.\" Copyright (c) 2006,2007 Joseph Koshy. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 16, 2006 +.Dd October 21, 2007 .Os .Dt GELF_GETPHDR 3 .Sh NAME @@ -57,10 +57,9 @@ and descriptors respectively. These descriptors are described in .Xr elf 5 . -The number of entries in this array is specified by the -.Va e_phnum -field of the executable header for ELF descriptor -.Ar elf . +The number of entries in this array may be determined using the +.Xr elf_getphnum 3 +function. .Pp Function .Fn gelf_getphdr @@ -134,6 +133,7 @@ was of an unsupported version. .Xr elf64_getehdr 3 , .Xr elf64_newphdr 3 , .Xr elf_flagphdr 3 , +.Xr elf_getphnum 3 , .Xr gelf 3 , .Xr gelf_getehdr 3 , .Xr gelf_newphdr 3 , diff --git a/lib/libelf/gelf_newphdr.3 b/lib/libelf/gelf_newphdr.3 index c94b47477979..ba39f9db14d3 100644 --- a/lib/libelf/gelf_newphdr.3 +++ b/lib/libelf/gelf_newphdr.3 @@ -1,4 +1,4 @@ -.\" Copyright (c) 2006 Joseph Koshy. All rights reserved. +.\" Copyright (c) 2006,2007 Joseph Koshy. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 25, 2006 +.Dd October 21, 2007 .Os .Dt GELF_NEWPHDR 3 .Sh NAME @@ -81,12 +81,6 @@ elements depending on the ELF class of ELF descriptor .Ar elf . .Pp The functions set the -.Va e_phnum -field of the executable header for ELF descriptor -.Ar elf -to -.Ar count , -and also set the .Dv ELF_F_DIRTY bit on the program header table. All members of the returned array of Phdr structures @@ -132,6 +126,7 @@ before using these APIs. .Xr elf64_getphdr 3 , .Xr elf64_newehdr 3 , .Xr elf_flagphdr 3 , +.Xr elf_getphnum 3 , .Xr gelf 3 , .Xr gelf_getphdr 3 , .Xr gelf_newehdr 3 ,