ADC Home > Reference Library > Reference > Mac OS X > Mac OS X Man Pages

 

This document is a Mac OS X manual page. Manual pages are a command-line technology for providing documentation. You can view these manual pages locally using the man(1) command. These manual pages come from many different sources, and thus, have a variety of writing styles.

This manual page is associated with the Mac OS X developer tools. The software or headers described may not be present on your Mac OS X installation until you install the developer tools package. This package is available on your Mac OS X installation DVD, and the latest versions can be downloaded from developer.apple.com.

For more information about the manual page format, see the manual page for manpages(5).



GETSECTBYNAME(3)                                                                            GETSECTBYNAME(3)



NAME
       getsectbyname, getsectdata - get the section information for the named section

SYNOPSIS
       #include <mach-o/getsect.h>

       const struct section *getsectbynamefromheader(
       const struct mach_header *mhp,
       const char *segname,
       const char *sectname)
       const struct section *getsectbyname(
       const char *segname,
       const char *sectname)
       char *getsectdatafromheader(
       const struct mach_header *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 NULL.  If the specified Mach header comes
       from  a dynamic library as returned by _dyld_get_image_header(3) the addr field in the section struc-ture structure
       ture will have to have _dyld_get_image_vmaddr_slide(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 _mh_execute_header.

       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 NULL for the pointer and zero for the size.  If the
       specified Mach header comes from a dynamic  library  as  returned  by  _dyld_get_image_header(3)  the
       address to the data returned will have to have _dyld_get_image_vmaddr_slide(3) added to it to make it
       a valid pointer.

       Getsectdata is the same as getsectdatafromheader with  its  first  argument  being  the  link  editor
       defined symbol _mh_execute_header.

       getsectdatafromFramework  is  used to get the named section data from the named Framework.  For exam-ple, example,
       ple, the framework name ``Appkit'' would be used for /System/Library/Frameworks/Appkit.framework/Ver-sions/C/Appkit. /System/Library/Frameworks/Appkit.framework/Versions/C/Appkit.
       sions/C/Appkit.   If  that  Framework  isn't  being  used by the program then it returns NULL for the
       pointer and zero for the size.

SEE ALSO
       dyld(3), getsegbyname(3)



Apple Computer, Inc.                           April 10, 1998                               GETSECTBYNAME(3)

Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.