📄 bfd-in2.h
字号:
unsigned long, unsigned long, unsigned long, boolean, int, boolean, boolean, struct sec **));/* Externally visible COFF routines. */#if defined(__STDC__) || defined(ALMOST_STDC)struct internal_syment;union internal_auxent;#endifextern boolean bfd_coff_get_syment PARAMS ((bfd *, struct symbol_cache_entry *, struct internal_syment *));extern boolean bfd_coff_get_auxent PARAMS ((bfd *, struct symbol_cache_entry *, int, union internal_auxent *));extern boolean bfd_coff_set_symbol_class PARAMS ((bfd *, struct symbol_cache_entry *, unsigned int));extern boolean bfd_m68k_coff_create_embedded_relocs PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *, char **));/* ARM Interworking support. Called from linker. */extern boolean bfd_arm_allocate_interworking_sections PARAMS ((struct bfd_link_info *));extern boolean bfd_arm_process_before_allocation PARAMS ((bfd *, struct bfd_link_info *, int));extern boolean bfd_arm_get_bfd_for_interworking PARAMS ((bfd *, struct bfd_link_info *));/* PE ARM Interworking support. Called from linker. */extern boolean bfd_arm_pe_allocate_interworking_sections PARAMS ((struct bfd_link_info *));extern boolean bfd_arm_pe_process_before_allocation PARAMS ((bfd *, struct bfd_link_info *, int));extern boolean bfd_arm_pe_get_bfd_for_interworking PARAMS ((bfd *, struct bfd_link_info *));/* ELF ARM Interworking support. Called from linker. */extern boolean bfd_elf32_arm_allocate_interworking_sections PARAMS ((struct bfd_link_info *));extern boolean bfd_elf32_arm_process_before_allocation PARAMS ((bfd *, struct bfd_link_info *, int));extern boolean bfd_elf32_arm_get_bfd_for_interworking PARAMS ((bfd *, struct bfd_link_info *));/* TI COFF load page support. */extern void bfd_ticoff_set_section_load_page PARAMS ((struct sec *, int));extern int bfd_ticoff_get_section_load_page PARAMS ((struct sec *));/* And more from the source. */voidbfd_init PARAMS ((void));bfd *bfd_openr PARAMS ((CONST char *filename, CONST char *target));bfd *bfd_fdopenr PARAMS ((CONST char *filename, CONST char *target, int fd));bfd *bfd_openstreamr PARAMS ((const char *, const char *, PTR));bfd *bfd_openw PARAMS ((CONST char *filename, CONST char *target));booleanbfd_close PARAMS ((bfd *abfd));booleanbfd_close_all_done PARAMS ((bfd *));bfd *bfd_create PARAMS ((CONST char *filename, bfd *templ));booleanbfd_make_writable PARAMS ((bfd *abfd));booleanbfd_make_readable PARAMS ((bfd *abfd));/* Byte swapping macros for user section data. */#define bfd_put_8(abfd, val, ptr) \ ((void) (*((unsigned char *) (ptr)) = (unsigned char) (val)))#define bfd_put_signed_8 \ bfd_put_8#define bfd_get_8(abfd, ptr) \ (*(unsigned char *) (ptr))#define bfd_get_signed_8(abfd, ptr) \ ((*(unsigned char *) (ptr) ^ 0x80) - 0x80)#define bfd_put_16(abfd, val, ptr) \ BFD_SEND(abfd, bfd_putx16, ((val),(ptr)))#define bfd_put_signed_16 \ bfd_put_16#define bfd_get_16(abfd, ptr) \ BFD_SEND(abfd, bfd_getx16, (ptr))#define bfd_get_signed_16(abfd, ptr) \ BFD_SEND (abfd, bfd_getx_signed_16, (ptr))#define bfd_put_32(abfd, val, ptr) \ BFD_SEND(abfd, bfd_putx32, ((val),(ptr)))#define bfd_put_signed_32 \ bfd_put_32#define bfd_get_32(abfd, ptr) \ BFD_SEND(abfd, bfd_getx32, (ptr))#define bfd_get_signed_32(abfd, ptr) \ BFD_SEND(abfd, bfd_getx_signed_32, (ptr))#define bfd_put_64(abfd, val, ptr) \ BFD_SEND(abfd, bfd_putx64, ((val), (ptr)))#define bfd_put_signed_64 \ bfd_put_64#define bfd_get_64(abfd, ptr) \ BFD_SEND(abfd, bfd_getx64, (ptr))#define bfd_get_signed_64(abfd, ptr) \ BFD_SEND(abfd, bfd_getx_signed_64, (ptr))#define bfd_get(bits, abfd, ptr) \ ((bits) == 8 ? bfd_get_8 (abfd, ptr) \ : (bits) == 16 ? bfd_get_16 (abfd, ptr) \ : (bits) == 32 ? bfd_get_32 (abfd, ptr) \ : (bits) == 64 ? bfd_get_64 (abfd, ptr) \ : (abort (), (bfd_vma) - 1))#define bfd_put(bits, abfd, val, ptr) \ ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \ : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \ : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \ : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \ : (abort (), (void) 0))/* Byte swapping macros for file header data. */#define bfd_h_put_8(abfd, val, ptr) \ bfd_put_8 (abfd, val, ptr)#define bfd_h_put_signed_8(abfd, val, ptr) \ bfd_put_8 (abfd, val, ptr)#define bfd_h_get_8(abfd, ptr) \ bfd_get_8 (abfd, ptr)#define bfd_h_get_signed_8(abfd, ptr) \ bfd_get_signed_8 (abfd, ptr)#define bfd_h_put_16(abfd, val, ptr) \ BFD_SEND(abfd, bfd_h_putx16,(val,ptr))#define bfd_h_put_signed_16 \ bfd_h_put_16#define bfd_h_get_16(abfd, ptr) \ BFD_SEND(abfd, bfd_h_getx16,(ptr))#define bfd_h_get_signed_16(abfd, ptr) \ BFD_SEND(abfd, bfd_h_getx_signed_16, (ptr))#define bfd_h_put_32(abfd, val, ptr) \ BFD_SEND(abfd, bfd_h_putx32,(val,ptr))#define bfd_h_put_signed_32 \ bfd_h_put_32#define bfd_h_get_32(abfd, ptr) \ BFD_SEND(abfd, bfd_h_getx32,(ptr))#define bfd_h_get_signed_32(abfd, ptr) \ BFD_SEND(abfd, bfd_h_getx_signed_32, (ptr))#define bfd_h_put_64(abfd, val, ptr) \ BFD_SEND(abfd, bfd_h_putx64,(val, ptr))#define bfd_h_put_signed_64 \ bfd_h_put_64#define bfd_h_get_64(abfd, ptr) \ BFD_SEND(abfd, bfd_h_getx64,(ptr))#define bfd_h_get_signed_64(abfd, ptr) \ BFD_SEND(abfd, bfd_h_getx_signed_64, (ptr))/* This structure is used for a comdat section, as in PE. A comdat section is associated with a particular symbol. When the linker sees a comdat section, it keeps only one of the sections with a given name and associated with a given symbol. */struct bfd_comdat_info{ /* The name of the symbol associated with a comdat section. */ const char *name; /* The local symbol table index of the symbol associated with a comdat section. This is only meaningful to the object file format specific code; it is not an index into the list returned by bfd_canonicalize_symtab. */ long symbol;};typedef struct sec{ /* The name of the section; the name isn't a copy, the pointer is the same as that passed to bfd_make_section. */ const char *name; /* A unique sequence number. */ int id; /* Which section is it; 0..nth. */ int index; /* The next section in the list belonging to the BFD, or NULL. */ struct sec *next; /* The field flags contains attributes of the section. Some flags are read in from the object file, and some are synthesized from other information. */ flagword flags;#define SEC_NO_FLAGS 0x000 /* Tells the OS to allocate space for this section when loading. This is clear for a section containing debug information only. */#define SEC_ALLOC 0x001 /* Tells the OS to load the section from the file when loading. This is clear for a .bss section. */#define SEC_LOAD 0x002 /* The section contains data still to be relocated, so there is some relocation information too. */#define SEC_RELOC 0x004#if 0 /* Obsolete ? */#define SEC_BALIGN 0x008#endif /* A signal to the OS that the section contains read only data. */#define SEC_READONLY 0x010 /* The section contains code only. */#define SEC_CODE 0x020 /* The section contains data only. */#define SEC_DATA 0x040 /* The section will reside in ROM. */#define SEC_ROM 0x080 /* The section contains constructor information. This section type is used by the linker to create lists of constructors and destructors used by <<g++>>. When a back end sees a symbol which should be used in a constructor list, it creates a new section for the type of name (e.g., <<__CTOR_LIST__>>), attaches the symbol to it, and builds a relocation. To build the lists of constructors, all the linker has to do is catenate all the sections called <<__CTOR_LIST__>> and relocate the data contained within - exactly the operations it would peform on standard data. */#define SEC_CONSTRUCTOR 0x100 /* The section is a constructor, and should be placed at the end of the text, data, or bss section(?). */#define SEC_CONSTRUCTOR_TEXT 0x1100#define SEC_CONSTRUCTOR_DATA 0x2100#define SEC_CONSTRUCTOR_BSS 0x3100 /* The section has contents - a data section could be <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be <<SEC_HAS_CONTENTS>> */#define SEC_HAS_CONTENTS 0x200 /* An instruction to the linker to not output the section even if it has information which would normally be written. */#define SEC_NEVER_LOAD 0x400 /* The section is a COFF shared library section. This flag is only for the linker. If this type of section appears in the input file, the linker must copy it to the output file without changing the vma or size. FIXME: Although this was originally intended to be general, it really is COFF specific (and the flag was renamed to indicate this). It might be cleaner to have some more general mechanism to allow the back end to control what the linker does with sections. */#define SEC_COFF_SHARED_LIBRARY 0x800 /* The section has GOT references. This flag is only for the linker, and is currently only used by the elf32-hppa back end. It will be set if global offset table references were detected in this section, which indicate to the linker that the section contains PIC code, and must be handled specially when doing a static link. */#define SEC_HAS_GOT_REF 0x4000 /* The section contains common symbols (symbols may be defined multiple times, the value of a symbol is the amount of space it requires, and the largest symbol value is the one used). Most targets have exactly one of these (which we translate to bfd_com_section_ptr), but ECOFF has two. */#define SEC_IS_COMMON 0x8000 /* The section contains only debugging information. For example, this is set for ELF .debug and .stab sections. strip tests this flag to see if a section can be discarded. */#define SEC_DEBUGGING 0x10000 /* The contents of this section are held in memory pointed to by the contents field. This is checked by bfd_get_section_contents, and the data is retrieved from memory if appropriate. */#define SEC_IN_MEMORY 0x20000 /* The contents of this section are to be excluded by the linker for executable and shared objects unless those objects are to be further relocated. */#define SEC_EXCLUDE 0x40000 /* The contents of this section are to be sorted by the based on the address specified in the associated symbol table. */#define SEC_SORT_ENTRIES 0x80000 /* When linking, duplicate sections of the same name should be discarded, rather than being combined into a single section as is usually done. This is similar to how common symbols are handled. See SEC_LINK_DUPLICATES below. */#define SEC_LINK_ONCE 0x100000 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker should handle duplicate sections. */#define SEC_LINK_DUPLICATES 0x600000 /* This value for SEC_LINK_DUPLICATES means that duplicate sections with the same name should simply be discarded. */#define SEC_LINK_DUPLICATES_DISCARD 0x0 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if there are any duplicate sections, although it should still only link one copy. */#define SEC_LINK_DUPLICATES_ONE_ONLY 0x200000 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if any duplicate sections are a different size. */#define SEC_LINK_DUPLICATES_SAME_SIZE 0x400000 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if any duplicate sections contain different contents. */#define SEC_LINK_DUPLICATES_SAME_CONTENTS 0x600000 /* This section was created by the linker as part of dynamic relocation or other arcane processing. It is skipped when going through the first-pass output, trusting that someone
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -