Lines Matching refs:object

14 use object::write::{
17 use object::{
29 binary_format: object::BinaryFormat,
30 architecture: object::Architecture,
31 flags: object::FileFlags,
32 endian: object::Endianness,
52 let mut file_flags = object::FileFlags::None; in new()
54 target_lexicon::BinaryFormat::Elf => object::BinaryFormat::Elf, in new()
55 target_lexicon::BinaryFormat::Coff => object::BinaryFormat::Coff, in new()
56 target_lexicon::BinaryFormat::Macho => object::BinaryFormat::MachO, in new()
72 target_lexicon::Architecture::X86_32(_) => object::Architecture::I386, in new()
73 target_lexicon::Architecture::X86_64 => object::Architecture::X86_64, in new()
74 target_lexicon::Architecture::Arm(_) => object::Architecture::Arm, in new()
75 target_lexicon::Architecture::Aarch64(_) => object::Architecture::Aarch64, in new()
77 if binary_format != object::BinaryFormat::Elf { in new()
84 let mut eflags = object::elf::EF_RISCV_FLOAT_ABI_DOUBLE; in new()
93 eflags |= object::elf::EF_RISCV_RVC; in new()
96 file_flags = object::FileFlags::Elf { in new()
97 os_abi: object::elf::ELFOSABI_NONE, in new()
101 object::Architecture::Riscv64 in new()
103 target_lexicon::Architecture::S390x => object::Architecture::S390x, in new()
111 target_lexicon::Endianness::Little => object::Endianness::Little, in new()
112 target_lexicon::Endianness::Big => object::Endianness::Big, in new()
145 object: Object<'static>, field
161 let mut object = Object::new(builder.binary_format, builder.architecture, builder.endian); in new() localVariable
162 object.flags = builder.flags; in new()
163 object.set_subsections_via_symbols(); in new()
164 object.add_file_symbol(builder.name); in new()
167 object, in new()
217 let symbol = self.object.symbol_mut(function); in declare_function()
221 let symbol_id = self.object.add_symbol(Symbol { in declare_function()
240 let symbol_id = self.object.add_symbol(Symbol { in declare_anonymous_function()
283 let symbol = self.object.symbol_mut(data); in declare_data()
288 let symbol_id = self.object.add_symbol(Symbol { in declare_data()
313 let symbol_id = self.object.add_symbol(Symbol { in declare_anonymous_data()
427 self.object.add_subsection(section_kind, b"subsection") in define_data()
429 self.object.section_id(section_kind) in define_data()
438 self.object.add_section( in define_data()
452 match self.object.format() { in define_data()
453 object::BinaryFormat::Elf => match self.object.section_flags_mut(section) { in define_data()
457 object::BinaryFormat::Coff => {} in define_data()
458 object::BinaryFormat::MachO => match self.object.symbol_flags_mut(symbol) { in define_data()
459 SymbolFlags::MachO { n_desc } => *n_desc |= object::macho::N_NO_DEAD_STRIP, in define_data()
472 .object in define_data()
475 .object in define_data()
515 self.object in define_function_inner()
518 self.object.section_id(StandardSection::Text) in define_function_inner()
520 let offset = self.object.add_symbol_data(symbol, section, bytes, align); in define_function_inner()
573 self.object in finish()
588 if self.object.format() == object::BinaryFormat::Elf { in finish()
589 self.object.add_section( in finish()
597 object: self.object, in finish()
618 if let Some(symbol) = self.object.symbol_id(name.as_bytes()) { in get_symbol()
623 let symbol = self.object.add_symbol(Symbol { in get_symbol()
643 let symbol = self.object.add_symbol(match known_symbol { in get_symbol()
675 let func_symbol = self.object.symbol(func_symbol_id); in get_symbol()
678 let symbol_id = self.object.add_symbol(Symbol { in get_symbol()
743 self.object.format(), in process_reloc()
744 object::BinaryFormat::Elf, in process_reloc()
748 r_type: object::elf::R_X86_64_TLSGD, in process_reloc()
753 self.object.format(), in process_reloc()
754 object::BinaryFormat::MachO, in process_reloc()
758 r_type: object::macho::X86_64_RELOC_TLV, in process_reloc()
765 self.object.format(), in process_reloc()
766 object::BinaryFormat::MachO, in process_reloc()
770 r_type: object::macho::ARM64_RELOC_TLVP_LOAD_PAGE21, in process_reloc()
777 self.object.format(), in process_reloc()
778 object::BinaryFormat::MachO, in process_reloc()
782 r_type: object::macho::ARM64_RELOC_TLVP_LOAD_PAGEOFF12, in process_reloc()
789 self.object.format(), in process_reloc()
790 object::BinaryFormat::Elf, in process_reloc()
794 r_type: object::elf::R_AARCH64_TLSDESC_ADR_PAGE21, in process_reloc()
799 self.object.format(), in process_reloc()
800 object::BinaryFormat::Elf, in process_reloc()
804 r_type: object::elf::R_AARCH64_TLSDESC_LD64_LO12, in process_reloc()
809 self.object.format(), in process_reloc()
810 object::BinaryFormat::Elf, in process_reloc()
814 r_type: object::elf::R_AARCH64_TLSDESC_ADD_LO12, in process_reloc()
819 self.object.format(), in process_reloc()
820 object::BinaryFormat::Elf, in process_reloc()
824 r_type: object::elf::R_AARCH64_TLSDESC_CALL, in process_reloc()
828 Reloc::Aarch64AdrGotPage21 => match self.object.format() { in process_reloc()
829 object::BinaryFormat::Elf => RelocationFlags::Elf { in process_reloc()
830 r_type: object::elf::R_AARCH64_ADR_GOT_PAGE, in process_reloc()
832 object::BinaryFormat::MachO => RelocationFlags::MachO { in process_reloc()
833 r_type: object::macho::ARM64_RELOC_GOT_LOAD_PAGE21, in process_reloc()
839 Reloc::Aarch64Ld64GotLo12Nc => match self.object.format() { in process_reloc()
840 object::BinaryFormat::Elf => RelocationFlags::Elf { in process_reloc()
841 r_type: object::elf::R_AARCH64_LD64_GOT_LO12_NC, in process_reloc()
843 object::BinaryFormat::MachO => RelocationFlags::MachO { in process_reloc()
844 r_type: object::macho::ARM64_RELOC_GOT_LOAD_PAGEOFF12, in process_reloc()
850 Reloc::Aarch64AdrPrelPgHi21 => match self.object.format() { in process_reloc()
851 object::BinaryFormat::Elf => RelocationFlags::Elf { in process_reloc()
852 r_type: object::elf::R_AARCH64_ADR_PREL_PG_HI21, in process_reloc()
854 object::BinaryFormat::MachO => RelocationFlags::MachO { in process_reloc()
855 r_type: object::macho::ARM64_RELOC_PAGE21, in process_reloc()
861 Reloc::Aarch64AddAbsLo12Nc => match self.object.format() { in process_reloc()
862 object::BinaryFormat::Elf => RelocationFlags::Elf { in process_reloc()
863 r_type: object::elf::R_AARCH64_ADD_ABS_LO12_NC, in process_reloc()
865 object::BinaryFormat::MachO => RelocationFlags::MachO { in process_reloc()
866 r_type: object::macho::ARM64_RELOC_PAGEOFF12, in process_reloc()
884 self.object.format(), in process_reloc()
885 object::BinaryFormat::Elf, in process_reloc()
889 r_type: object::elf::R_390_TLS_GD64, in process_reloc()
894 self.object.format(), in process_reloc()
895 object::BinaryFormat::Elf, in process_reloc()
899 r_type: object::elf::R_390_TLS_GDCALL, in process_reloc()
904 self.object.format(), in process_reloc()
905 object::BinaryFormat::Elf, in process_reloc()
909 r_type: object::elf::R_RISCV_CALL_PLT, in process_reloc()
914 self.object.format(), in process_reloc()
915 object::BinaryFormat::Elf, in process_reloc()
919 r_type: object::elf::R_RISCV_TLS_GD_HI20, in process_reloc()
924 self.object.format(), in process_reloc()
925 object::BinaryFormat::Elf, in process_reloc()
929 r_type: object::elf::R_RISCV_PCREL_LO12_I, in process_reloc()
934 self.object.format(), in process_reloc()
935 object::BinaryFormat::Elf, in process_reloc()
939 r_type: object::elf::R_RISCV_GOT_HI20, in process_reloc()
973 pub object: Object<'static>, field
995 pub fn emit(self) -> Result<Vec<u8>, object::write::Error> { in emit()
996 self.object.write() in emit()