ELFTC_BFD_FIND_TARGET(3)
π ELFTC_BFD_FIND_TARGET(3) β Library Functions Manual π
okay bestie, gather round: this is the Library Functions Manual page for the libelftc binary object descriptor girlies, and yes she ate π
β¨ NAME β¨
elftc_bfd_find_target, elftc_bfd_target_byteorder, elftc_bfd_target_class, elftc_bfd_target_flavor, elftc_bfd_target_machine β binary object descriptor handling, no cap π¦
π«Ά LIBRARY π«Ά
library βlibelftcβ β that's the one, bestie.
π SYNOPSIS π
#include <libelftc.h>
struct Elftc_Bfd_Target;
Elftc_Bfd_Target *
elftc_bfd_find_target(const char *target_name);
unsigned int
elftc_bfd_target_class(Elftc_Bfd_Target *target);
unsigned int
elftc_bfd_target_byteorder(Elftc_Bfd_Target *target);
Elftc_Bfd_Target_Flavor
elftc_bfd_target_flavor(Elftc_Bfd_Target *target);
unsigned int
elftc_bfd_target_machine(Elftc_Bfd_Target *target);
unsigned int
elftc_bfd_target_osabi(Elftc_Bfd_Target *target);
π¦ DESCRIPTION π¦
okay so elftc_bfd_find_target() is literally the lil matchmaker: it locates a binary object descriptor corresponding to the descriptor name in argument target_name. Binary object descriptors encapsulate properties of an object format such as its file representation, ELF class, and byte endianness β it's giving βeverything you need to know about this formatβ energy β¨
Known descriptor names and their properties include:
Each bullet below is Name β Object Format, Byte Order, Bit Width. Zero skips, periodt.
binaryβ Object Format:Binary; Byte Order:-; Bit Width:-.efi-app-ia32β Object Format:PE; Byte Order:LSB; Bit Width:32.efi-app-x86_64β Object Format:PE; Byte Order:LSB; Bit Width:64.elf32-avrβ Object Format:ELF; Byte Order:LSB; Bit Width:32.elf32-bigβ Object Format:ELF; Byte Order:MSB; Bit Width:32.elf32-bigarmβ Object Format:ELF; Byte Order:MSB; Bit Width:32.elf32-bigmipsβ Object Format:ELF; Byte Order:MSB; Bit Width:32.elf32-i386β Object Format:ELF; Byte Order:LSB; Bit Width:32.elf32-i386-freebsdβ Object Format:ELF; Byte Order:LSB; Bit Width:32.elf32-ia64-bigβ Object Format:ELF; Byte Order:MSB; Bit Width:32.elf32-littleβ Object Format:ELF; Byte Order:LSB; Bit Width:32.elf32-littlearmβ Object Format:ELF; Byte Order:LSB; Bit Width:32.elf32-littlemipsβ Object Format:ELF; Byte Order:LSB; Bit Width:32.elf32-powerpcβ Object Format:ELF; Byte Order:MSB; Bit Width:32.elf32-powerpc-freebsdβ Object Format:ELF; Byte Order:MSB; Bit Width:32.elf32-powerpcleβ Object Format:ELF; Byte Order:LSB; Bit Width:32.elf32-riscvβ Object Format:ELF; Byte Order:LSB; Bit Width:32.elf64-riscvβ Object Format:ELF; Byte Order:LSB; Bit Width:64.elf64-riscv-freebsdβ Object Format:ELF; Byte Order:LSB; Bit Width:64.elf32-shβ Object Format:ELF; Byte Order:MSB; Bit Width:32.elf32-shlβ Object Format:ELF; Byte Order:LSB; Bit Width:32.elf32-sh-nbsdβ Object Format:ELF; Byte Order:MSB; Bit Width:32.elf32-shl-nbsdβ Object Format:ELF; Byte Order:LSB; Bit Width:32.elf32-shbig-linuxβ Object Format:ELF; Byte Order:MSB; Bit Width:32.elf32-shl-linuxβ Object Format:ELF; Byte Order:LSB; Bit Width:32.elf32-sparcβ Object Format:ELF; Byte Order:MSB; Bit Width:32.elf32-tradbigmipsβ Object Format:ELF; Byte Order:MSB; Bit Width:32.elf32-tradlittlemipsβ Object Format:ELF; Byte Order:LSB; Bit Width:32.elf64-alphaβ Object Format:ELF; Byte Order:LSB; Bit Width:64.elf64-alpha-freebsdβ Object Format:ELF; Byte Order:LSB; Bit Width:64.elf64-bigβ Object Format:ELF; Byte Order:MSB; Bit Width:64.elf64-bigmipsβ Object Format:ELF; Byte Order:MSB; Bit Width:64.elf64-ia64-bigβ Object Format:ELF; Byte Order:MSB; Bit Width:64.elf64-ia64-littleβ Object Format:ELF; Byte Order:LSB; Bit Width:64.elf64-littleβ Object Format:ELF; Byte Order:LSB; Bit Width:64.elf64-littleaarch64β Object Format:ELF; Byte Order:LSB; Bit Width:64.elf64-littlemipsβ Object Format:ELF; Byte Order:LSB; Bit Width:64.elf64-powerpcβ Object Format:ELF; Byte Order:MSB; Bit Width:64.elf64-powerpc-freebsdβ Object Format:ELF; Byte Order:MSB; Bit Width:64.elf64-powerpcleβ Object Format:ELF; Byte Order:LSB; Bit Width:64.elf64-sh64β Object Format:ELF; Byte Order:MSB; Bit Width:64.elf64-sh64lβ Object Format:ELF; Byte Order:LSB; Bit Width:64.elf64-sh64-nbsdβ Object Format:ELF; Byte Order:MSB; Bit Width:64.elf64-sh64l-nbsdβ Object Format:ELF; Byte Order:LSB; Bit Width:64.elf64-sh64big-linuxβ Object Format:ELF; Byte Order:MSB; Bit Width:64.elf64-sh64-linuxβ Object Format:ELF; Byte Order:LSB; Bit Width:64.elf64-sparcβ Object Format:ELF; Byte Order:MSB; Bit Width:64.elf64-sparc-freebsdβ Object Format:ELF; Byte Order:MSB; Bit Width:64.elf64-tradbigmipsβ Object Format:ELF; Byte Order:MSB; Bit Width:64.elf64-tradlittlemipsβ Object Format:ELF; Byte Order:LSB; Bit Width:64.elf64-x86-64β Object Format:ELF; Byte Order:LSB; Bit Width:64.elf64-x86-64-freebsdβ Object Format:ELF; Byte Order:LSB; Bit Width:64.ihexβ Object Format:IHEX; Byte Order:-; Bit Width:-.pei-i386β Object Format:PE; Byte Order:LSB; Bit Width:32.pei-x86-64β Object Format:PE; Byte Order:LSB; Bit Width:64.srecβ Object Format:SREC; Byte Order:-; Bit Width:-.symbolsrecβ Object Format:SREC; Byte Order:-; Bit Width:-.
Function elftc_bfd_target_byteorder() returns the ELF byte order associated with target descriptor target. slay.
Function elftc_bfd_target_class() returns the ELF class associated with target descriptor target. iconic.
Function elftc_bfd_target_flavor() returns the object format associated with target descriptor target. The known object formats are:
ETF_ELFβ An ELF object.ETF_BINARYβ Raw binary.ETF_IHEXβ An object encoded in Intel hex format.ETF_NONEβ An unknown object format.ETF_SRECβ An object encoded as S-records.
π RETURN VALUES π
Function elftc_bfd_find_target() returns a valid pointer to an opaque binary target descriptor if successful, or NULL in case of an error. (We love a successful pointer, and we respect the NULL moment tbh π)
Function elftc_bfd_target_byteorder() returns the ELF byte order associated with the target descriptor; one of ELFDATA2MSB or ELFDATA2LSB.
Function elftc_bfd_target_class() returns the ELF class associated with the target descriptor; one of ELFCLASS32 or ELFCLASS64.
Function elftc_bfd_target_machine() returns the ELF architecture associated with the target descriptor.
Function elftc_bfd_target_flavor() returns one of ETF_BINARY, ETF_ELF, ETF_IHEX or ETF_SREC if successful or ETF_NONE in case of error.
π EXAMPLES π
To return descriptor information associated with target name βelf64-bigβ use:
struct Elftc_Bfd_Target *t;
if ((t = elftc_bfd_find_target("elf64-big")) == NULL)
errx(EXIT_FAILURE, "Cannot find target descriptor");
printf("Class: %s\n", elftc_bfd_target_class(t) == ELFCLASS32 ?
"ELFCLASS32" : "ELFCLASS64");
printf("Byteorder: %s\n",
elftc_bfd_target_byteorder(t) == ELFDATA2LSB ? "LSB" : "MSB");
printf("Flavor: %d\n", elftc_bfd_target_flavor(t));
π SEE ALSO π
okay that's the whole page, mwah π β footer energy: Debian, February 12, 2020, filed under ELFTC_BFD_FIND_TARGET(3). byeee π«Άβ¨
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: libelftc 15.0.0
- Copyright (c) 2010-2011 Joseph Koshy. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms