Lines Matching +full:vd +full:- +full:supply
1 /*-
2 * Copyright (c) 2006-2011 Joseph Koshy
33 ELFTC_VCSID("$Id: libelf_convert.m4 3712 2019-03-16 22:23:34Z jkoshy $");
37 divert(-1)
39 # Generate conversion routines for converting between in-memory and
56 # can be 32- or 64- bit wide.
69 # `In-memory' representations of an Elf data structure use natural
73 # tighter than its `in-memory' representation, and could be of a
87 # NOCVT(TYPE) -- Do not generate the cvt[] structure entry for TYPE
90 # NOFUNC(TYPE) -- Do not generate a conversion function for TYPE
93 # IGNORE(TYPE) -- Completely ignore the type.
98 # Types for which we use functions with non-standard names.
102 # Types for which we supply hand-coded functions.
110 # ELF types that don't exist in a 32-bit world.
129 # Note the primitive types that are size-dependent.
195 # SWAP_FIELD(FIELDNAME,ELFTYPE) -- Generate code to swap one field.
203 # SWAP_MEMBERS(STRUCT) -- Iterate over a structure definition.
208 # SWAP_STRUCT(CTYPE,SIZE) -- Generate code to swap an ELF structure.
213 # WRITE_FIELD(ELFTYPE,FIELDNAME) -- Generate code to write one field.
221 # WRITE_MEMBERS(ELFTYPELIST) -- Iterate over a structure definition.
226 # WRITE_STRUCT(CTYPE,SIZE) -- Generate code to write out an ELF structure.
231 # READ_FIELD(ELFTYPE,CTYPE) -- Generate code to read one field.
239 # READ_MEMBERS(ELFTYPELIST) -- Iterate over a structure definition.
244 # READ_STRUCT(CTYPE,SIZE) -- Generate code to read an ELF structure.
250 # MAKECOMPFUNCS -- Generate converters for composite ELF structures.
253 # be naturally aligned for a data structure's in-memory
257 # For in-place conversions, when converting to file representations,
297 d = ((Elf$3_$2 *) (uintptr_t) dst) + (count - 1);
298 s0 = src + (count - 1) * fsz;
303 while (count--) {
309 *d-- = t; s0 -= fsz;
320 # - Skip convertors marked as `NOFUNC'.
321 # - Invoke `MAKEPRIMFUNCS' or `MAKECOMPFUNCS' as appropriate.
332 # MAKE_TYPE_CONVERTERS(ELFTYPELIST) -- Generate conversion functions.
379 # _FSZ(FIELD,BASETYPE) - return the file size for a field.
384 # FSZ(STRUCT) - determine the file size of a structure.
389 # MAKE_VERSION_CONVERTERS(TYPE,BASE,AUX,PFX) -- Generate conversion
395 # MAKE_VERSION_CONVERTOR(TYPE,CBASE,CAUX,PFX,SIZE) -- Generate a
438 dstaux += anext, srcaux += anext, cnt--) {
502 dstaux += anext, srcaux += anext, cnt--) {
575 * - The destination pointer could be unaligned.
576 * - Values are written out in native byte order.
577 * - The destination pointer is incremented after the write.
633 * - The source pointer could be unaligned.
634 * - Values are read in native byte order.
635 * - The source pointer is incremented appropriately.
696 #define ROUNDUP2(V,N) (V) = ((((V) + (N) - 1)) & ~((N) - 1))
700 MAKE_VERSION_CONVERTERS(VDEF,Verdef,Verdaux,vd)
722 * Sections of type ELF_T_GNUHASH start with a header containing 4 32-bit
731 * 32-bit case we need to translate `srcsz' to a count of 32-bit words.
770 srcsz -= sz;
785 gh->gh_nbuckets = nbuckets;
786 gh->gh_symndx = symndx;
787 gh->gh_maskwords = maskwords;
788 gh->gh_shift2 = shift2;
790 dsz -= sizeof(Elf_GNU_Hash_Header);
817 dsz -= sz;
818 srcsz -= sz;
852 t0 = nbuckets = gh->gh_nbuckets;
853 t1 = gh->gh_symndx;
854 t2 = maskwords = gh->gh_maskwords;
855 t3 = gh->gh_shift2;
858 srcsz -= sizeof(Elf_GNU_Hash_Header);
859 dsz -= hdrsz;
861 sz = gh->gh_nbuckets * sizeof(uint32_t) + gh->gh_maskwords *
897 srcsz -= sz;
898 dsz -= sz;
957 en->n_namesz = namesz;
958 en->n_descsz = descsz;
959 en->n_type = type;
961 dsz -= sizeof(Elf_Note);
963 count -= hdrsz;
978 count -= sz;
979 dsz -= sz;
1004 namesz = en->n_namesz;
1005 descsz = en->n_descsz;
1006 type = en->n_type;
1022 count -= sizeof(Elf_Note);
1031 count -= sz;
1055 * Types that need hand-coded converters follow.