chromium/third_party/nasm/output/macho.h

/* ----------------------------------------------------------------------- *
 *
 *   Copyright 1996-2018 The NASM Authors - All Rights Reserved
 *   See the file AUTHORS included with the NASM distribution for
 *   the specific copyright holders.
 *
 *   Redistribution and use in source and binary forms, with or without
 *   modification, are permitted provided that the following
 *   conditions are met:
 *
 *   * Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *   * Redistributions in binary form must reproduce the above
 *     copyright notice, this list of conditions and the following
 *     disclaimer in the documentation and/or other materials provided
 *     with the distribution.
 *
 *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
 *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
 *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * ----------------------------------------------------------------------- */

#ifndef OUTPUT_MACHO_H
#define OUTPUT_MACHO_H

#include "compiler.h"

/* Magics */
#define MH_MAGIC
#define MH_MAGIC_64

/* File types */
#define MH_OBJECT

/* CPUs */
#define CPU_ARCH_MASK
#define CPU_ARCH_ABI64
#define CPU_TYPE_X86
#define CPU_TYPE_I386
#define CPU_TYPE_X86_64

#define CPU_SUBTYPE_MASK
#define CPU_SUBTYPE_I386_ALL

/* Header flags */
#define MH_SUBSECTIONS_VIA_SYMBOLS

/* Load commands */
#define LC_SEGMENT
#define LC_SEGMENT_64
#define LC_SYMTAB
#define LC_BUILD_VERSION

/* Symbol type bits */
#define N_STAB
#define N_PEXT
#define N_TYPE
#define N_EXT

/* To mask with N_TYPE */
#define N_UNDF
#define N_ABS
#define N_INDR
#define N_PBUD
#define N_SECT

/* Section ordinals */
#define NO_SECT
#define MAX_SECT

/* Section bits */
#define SECTION_TYPE
#define SECTION_ATTRIBUTES
#define SECTION_ATTRIBUTES_USR
#define SECTION_ATTRIBUTES_SYS

#define S_REGULAR
#define S_ZEROFILL
#define S_CSTRING_LITERALS
#define S_4BYTE_LITERALS
#define S_8BYTE_LITERALS
#define S_LITERAL_POINTERS
#define S_NON_LAZY_SYMBOL_POINTERS
#define S_LAZY_SYMBOL_POINTERS
#define S_SYMBOL_STUBS
#define S_MOD_INIT_FUNC_POINTERS
#define S_MOD_TERM_FUNC_POINTERS
#define S_COALESCED
#define S_GB_ZEROFILL
#define S_INTERPOSING
#define S_16BYTE_LITERALS
#define S_DTRACE_DOF
#define S_LAZY_DYLIB_SYMBOL_POINTERS
#define S_THREAD_LOCAL_REGULAR
#define S_THREAD_LOCAL_ZEROFILL
#define S_THREAD_LOCAL_VARIABLES
#define S_THREAD_LOCAL_VARIABLE_POINTERS
#define S_THREAD_LOCAL_INIT_FUNCTION_POINTERS

#define S_ATTR_PURE_INSTRUCTIONS
#define S_ATTR_NO_TOC
#define S_ATTR_STRIP_STATIC_SYMS
#define S_ATTR_NO_DEAD_STRIP
#define S_ATTR_LIVE_SUPPORT
#define S_ATTR_SELF_MODIFYING_CODE
#define S_ATTR_DEBUG

#define S_ATTR_SOME_INSTRUCTIONS
#define S_ATTR_EXT_RELOC
#define S_ATTR_LOC_RELOC
#define INDIRECT_SYMBOL_LOCAL
#define INDIRECT_SYMBOL_ABS

/* Relocation info type */
#define GENERIC_RELOC_VANILLA
#define GENERIC_RELOC_PAIR
#define GENERIC_RELOC_SECTDIFF
#define GENERIC_RELOC_PB_LA_PTR
#define GENERIC_RELOC_LOCAL_SECTDIFF
#define GENERIC_RELOC_TLV

#define X86_64_RELOC_UNSIGNED
#define X86_64_RELOC_SIGNED
#define X86_64_RELOC_BRANCH
#define X86_64_RELOC_GOT_LOAD
#define X86_64_RELOC_GOT
#define X86_64_RELOC_SUBTRACTOR
#define X86_64_RELOC_SIGNED_1
#define X86_64_RELOC_SIGNED_2
#define X86_64_RELOC_SIGNED_4
#define X86_64_RELOC_TLV

/* Relocation info */
#define R_ABS
#define R_SCATTERED

/* Known values for the platform field in LC_BUILD_VERSION */
#define PLATFORM_MACOS
#define PLATFORM_IOS
#define PLATFORM_TVOS
#define PLATFORM_WATCHOS
#define PLATFORM_BRIDGEOS
#define PLATFORM_MACCATALYST
#define PLATFORM_IOSSIMULATOR
#define PLATFORM_TVOSSIMULATOR
#define PLATFORM_WATCHOSSIMULATOR
#define PLATFORM_DRIVERKIT

#define PLATFORM_INVALID

/* VM permission constants */
#define VM_PROT_NONE
#define VM_PROT_READ
#define VM_PROT_WRITE
#define VM_PROT_EXECUTE

macho_header_t;

macho_header_64_t;

macho_load_command_t;

macho_segment_command_t;

macho_segment_command_64_t;

macho_section_t;

macho_section_64_t;

macho_symtab_command_t;

macho_relocation_info_t;

macho_nlist_base_t;

macho_nlist_t;

macho_nlist_64_t;

#endif /* OUTPUT_MACHO_H */