firasuke / cross / slibtool

Forked from cross/slibtool 3 months ago
Clone

Blame src/internal/slibtool_ar_impl.h

11f3c7
#ifndef SLIBTOOL_AR_IMPL_H
11f3c7
#define SLIBTOOL_AR_IMPL_H
11f3c7
11f3c7
#include "argv/argv.h"
d4473b
#include <slibtool/slibtool.h>
d4473b
#include <slibtool/slibtool_arbits.h>
11f3c7
11f3c7
extern const struct argv_option slbt_ar_options[];
11f3c7
d4473b
struct ar_armaps_impl {
7fe83d
	struct ar_meta_armap_ref_32 *   armap_symrefs_32;
7fe83d
	struct ar_meta_armap_ref_64 *   armap_symrefs_64;
d4473b
	struct ar_raw_armap_bsd_32      armap_bsd_32;
d4473b
	struct ar_raw_armap_bsd_64      armap_bsd_64;
d4473b
	struct ar_raw_armap_sysv_32     armap_sysv_32;
d4473b
	struct ar_raw_armap_sysv_64     armap_sysv_64;
d4473b
	struct ar_meta_armap_common_32  armap_common_32;
d4473b
	struct ar_meta_armap_common_64  armap_common_64;
d4473b
	uint64_t                        armap_nsyms;
d4473b
};
d4473b
d4473b
struct slbt_archive_meta_impl {
244523
	const struct slbt_driver_ctx *  dctx;
562b43
	size_t                          nentries;
d4473b
	void *                          hdrinfov;
d4473b
	char *                          namestrs;
d4473b
	const char *                    symstrs;
d4473b
	const char **                   symstrv;
405946
	off_t *                         offsetv;
d4473b
	struct ar_meta_member_info **   memberv;
d4473b
	struct ar_meta_member_info *    members;
d4473b
	struct ar_armaps_impl           armaps;
d4473b
	struct slbt_archive_meta        armeta;
d4473b
};
d4473b
8567ec
struct ar_meta_member_info * slbt_archive_member_from_offset(
8567ec
	struct slbt_archive_meta_impl * meta,
8567ec
	off_t                           offset);
8567ec
d4473b
static inline struct slbt_archive_meta_impl * slbt_archive_meta_ictx(const struct slbt_archive_meta * meta)
d4473b
{
d4473b
	uintptr_t addr;
d4473b
d4473b
	if (meta) {
d4473b
		addr = (uintptr_t)meta - offsetof(struct slbt_archive_meta_impl,armeta);
d4473b
		return (struct slbt_archive_meta_impl *)addr;
d4473b
	}
d4473b
d4473b
	return 0;
d4473b
}
d4473b
11f3c7
#endif