GETSECTBYNAME(3) GETSECTBYNAME(3)
NAME
getsectbyname, getsectdata - get the section information for the named
section
SYNOPSIS
##include <>
const struct section *getsectbynamefromheader(
const struct machheader *mhp,
const char *segname,
const char *sectname)
const struct section *getsectbyname(
const char *segname,
const char *sectname)
char *getsectdatafromheader(
const struct machheader *mhp,
const char *segname,
const char *sectname,
unsigned long *size)
char *getsectdata(
const char *segname,
const char *sectname,
unsigned long *size)
char *getsectdatafromFramework(
const char *FrameworkName,
const char *segname,
const char *sectname,
unsigned long *size)
DESCRIPTION
Getsectbynamefromheader returns the section structure for the named
section in the named segment if it exists in the specified Mach header
otherwise it returns NUL. If the specified Mach header comes from a
dynamic library as returned by dyldgetimageheader(3) the addr field
in the section structure will have to have
dyldgetimagevmaddrslide(3) added to it to make it a valid pointer.
Getsectbyname is the same as getsectbynamefromheader with its first
argument being the link editor defined symbol mhexecuteheader.
Getsectdatafromheader returns the address to the data for the named
section in the named segment if it exists in the specified Mach header.
Also it returns the size of the section data indirectly through the
pointer size. Otherwise it returns NUL for the pointer and zero for
the size. If the specified Mach header comes from a dynamic library as
returned by dyldgetimageheader(3) the address to the data returned
will have to have dyldgetimagevmaddrslide(3) added to it to make
it a valid pointer.
Getsectdata is the same as getsectdatafromheader with its first argu-
ment being the link editor defined symbol mhexecuteheader.
getsectdatafromFramework is used to get the named section data from the
named Framework. For example, the framework name ``Appkit'' would be
used for /System/Library/Frameworks/Appkit.framework/Versions/C/Appkit.
If that Framework isn't being used by the program then it returns NUL
for the pointer and zero for the size.
SEE ALSO
dyld(3), getsegbyname(3)
Apple Computer, Inc. April 10, 1998 GETSECTBYNAME(3)
|