Class MachHeaderFlags


  • public final class MachHeaderFlags
    extends java.lang.Object
    Constants for the flags field of the mach_header
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int MH_ALLMODSBOUND
      indicates that this binary binds to all two-level namespace modules of its dependent libraries.
      static int MH_ALLOW_STACK_EXECUTION
      when this bit is set, all stacks in the task will be given stack execution privilege.
      static int MH_APP_EXTENSION_SAFE  
      static int MH_BINDATLOAD
      the object file's undefined references are bound by the dynamic linker when loaded.
      static int MH_BINDS_TO_WEAK
      the final linked image uses weak symbols.
      static int MH_CANONICAL
      the binary has been canonicalized via the unprebind operation.
      static int MH_DEAD_STRIPPABLE_DYLIB
      Only for use on dylibs.
      static int MH_DYLDLINK
      the object file is input for the dynamic linker and can't be staticly link edited again.
      static int MH_FORCE_FLAT
      the executable is forcing all images to use flat name space bindings.
      static int MH_HAS_TLV_DESCRIPTORS
      Contains a section of type S_THREAD_LOCAL_VARIABLES.
      static int MH_INCRLINK
      the object file is the output of an incremental link against a base file and can't be link edited again.
      static int MH_LAZY_INIT
      the shared library init routine is to be run lazily via catching memory faults to its writeable segments (obsolete).
      static int MH_NO_HEAP_EXECUTION
      When this bit is set, the OS will run the main executable with a non-executable heap even on platforms ( e.g., i386 ) that don't require it.
      static int MH_NO_REEXPORTED_DYLIBS
      When this bit is set on a dylib, the static linker does not need to examine dependent dylibs to see if any are re-exported
      static int MH_NOFIXPREBINDING
      do not have dyld notify the prebinding agent about this executable.
      static int MH_NOMULTIDEFS
      this umbrella guarantees no multiple defintions of symbols in its sub-images so the two-level namespace hints can always be used.
      static int MH_NOUNDEFS
      the object file has no undefined references.
      static int MH_PIE
      When this bit is set, the OS will load the main executable at a random address.
      static int MH_PREBINDABLE
      the binary is not prebound but can have its prebinding redone.
      static int MH_PREBOUND
      the file has its dynamic undefined references prebound.
      static int MH_ROOT_SAFE
      When this bit is set, the binary declares it is safe for use in processes with uid zero
      static int MH_SETUID_SAFE
      When this bit is set, the binary declares it is safe for use in processes when issetugid() is true
      static int MH_SPLIT_SEGS
      the file has its read-only and read-write segments split.
      static int MH_SUBSECTIONS_VIA_SYMBOLS
      safe to divide up the sections into sub-sections via symbols for dead code stripping.
      static int MH_TWOLEVEL
      the image is using two-level name space bindings.
      static int MH_WEAK_DEFINES
      the final linked image contains external weak symbols.
    • Constructor Summary

      Constructors 
      Constructor Description
      MachHeaderFlags()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<java.lang.String> getFlags​(int flags)
      Returns string representation of the flag values.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • MH_NOUNDEFS

        public static final int MH_NOUNDEFS
        the object file has no undefined references.
        See Also:
        Constant Field Values
      • MH_INCRLINK

        public static final int MH_INCRLINK
        the object file is the output of an incremental link against a base file and can't be link edited again.
        See Also:
        Constant Field Values
      • MH_DYLDLINK

        public static final int MH_DYLDLINK
        the object file is input for the dynamic linker and can't be staticly link edited again.
        See Also:
        Constant Field Values
      • MH_BINDATLOAD

        public static final int MH_BINDATLOAD
        the object file's undefined references are bound by the dynamic linker when loaded.
        See Also:
        Constant Field Values
      • MH_PREBOUND

        public static final int MH_PREBOUND
        the file has its dynamic undefined references prebound.
        See Also:
        Constant Field Values
      • MH_SPLIT_SEGS

        public static final int MH_SPLIT_SEGS
        the file has its read-only and read-write segments split.
        See Also:
        Constant Field Values
      • MH_LAZY_INIT

        public static final int MH_LAZY_INIT
        the shared library init routine is to be run lazily via catching memory faults to its writeable segments (obsolete).
        See Also:
        Constant Field Values
      • MH_TWOLEVEL

        public static final int MH_TWOLEVEL
        the image is using two-level name space bindings.
        See Also:
        Constant Field Values
      • MH_FORCE_FLAT

        public static final int MH_FORCE_FLAT
        the executable is forcing all images to use flat name space bindings.
        See Also:
        Constant Field Values
      • MH_NOMULTIDEFS

        public static final int MH_NOMULTIDEFS
        this umbrella guarantees no multiple defintions of symbols in its sub-images so the two-level namespace hints can always be used.
        See Also:
        Constant Field Values
      • MH_NOFIXPREBINDING

        public static final int MH_NOFIXPREBINDING
        do not have dyld notify the prebinding agent about this executable.
        See Also:
        Constant Field Values
      • MH_PREBINDABLE

        public static final int MH_PREBINDABLE
        the binary is not prebound but can have its prebinding redone. only used when MH_PREBOUND is not set.
        See Also:
        Constant Field Values
      • MH_ALLMODSBOUND

        public static final int MH_ALLMODSBOUND
        indicates that this binary binds to all two-level namespace modules of its dependent libraries. only used when MH_PREBINDABLE and MH_TWOLEVEL are both set.
        See Also:
        Constant Field Values
      • MH_SUBSECTIONS_VIA_SYMBOLS

        public static final int MH_SUBSECTIONS_VIA_SYMBOLS
        safe to divide up the sections into sub-sections via symbols for dead code stripping.
        See Also:
        Constant Field Values
      • MH_CANONICAL

        public static final int MH_CANONICAL
        the binary has been canonicalized via the unprebind operation.
        See Also:
        Constant Field Values
      • MH_WEAK_DEFINES

        public static final int MH_WEAK_DEFINES
        the final linked image contains external weak symbols.
        See Also:
        Constant Field Values
      • MH_BINDS_TO_WEAK

        public static final int MH_BINDS_TO_WEAK
        the final linked image uses weak symbols.
        See Also:
        Constant Field Values
      • MH_ALLOW_STACK_EXECUTION

        public static final int MH_ALLOW_STACK_EXECUTION
        when this bit is set, all stacks in the task will be given stack execution privilege. only used in MH_EXECUTE filetypes.
        See Also:
        Constant Field Values
      • MH_ROOT_SAFE

        public static final int MH_ROOT_SAFE
        When this bit is set, the binary declares it is safe for use in processes with uid zero
        See Also:
        Constant Field Values
      • MH_SETUID_SAFE

        public static final int MH_SETUID_SAFE
        When this bit is set, the binary declares it is safe for use in processes when issetugid() is true
        See Also:
        Constant Field Values
      • MH_NO_REEXPORTED_DYLIBS

        public static final int MH_NO_REEXPORTED_DYLIBS
        When this bit is set on a dylib, the static linker does not need to examine dependent dylibs to see if any are re-exported
        See Also:
        Constant Field Values
      • MH_PIE

        public static final int MH_PIE
        When this bit is set, the OS will load the main executable at a random address. Only used in MH_EXECUTE filetypes.
        See Also:
        Constant Field Values
      • MH_DEAD_STRIPPABLE_DYLIB

        public static final int MH_DEAD_STRIPPABLE_DYLIB
        Only for use on dylibs. When linking against a dylib that has this bit set, the static linker will automatically not create a LC_LOAD_DYLIB load command to the dylib if no symbols are being referenced from the dylib.
        See Also:
        Constant Field Values
      • MH_HAS_TLV_DESCRIPTORS

        public static final int MH_HAS_TLV_DESCRIPTORS
        Contains a section of type S_THREAD_LOCAL_VARIABLES.
        See Also:
        Constant Field Values
      • MH_NO_HEAP_EXECUTION

        public static final int MH_NO_HEAP_EXECUTION
        When this bit is set, the OS will run the main executable with a non-executable heap even on platforms ( e.g., i386 ) that don't require it. Only used in MH_EXECUTE file types.
        See Also:
        Constant Field Values
    • Constructor Detail

      • MachHeaderFlags

        public MachHeaderFlags()
    • Method Detail

      • getFlags

        public static final java.util.List<java.lang.String> getFlags​(int flags)
        Returns string representation of the flag values.