__elfN
#ifdef __elfN
extern u_int64_t __elfN(relocation_offset);
int __elfN(loadfile)(char *filename, u_int64_t dest, struct preloaded_file **result);
int __elfN(obj_loadfile)(char *filename, u_int64_t dest,
int __elfN(reloc)(struct elf_file *ef, symaddr_fn *symaddr,
if (strcmp(__elfN(kerneltype), kfp->f_type)) {
fp->f_type = strdup(ef.kernel ? __elfN(kerneltype) : __elfN(moduletype));
fp->f_size = __elfN(loadimage)(fp, &ef, dest);
__elfN(loadimage)(struct preloaded_file *fp, elf_file_t ef, u_int64_t off)
__elfN(relocation_offset) = off;
if (__elfN(parse_modmetadata)(fp, ef) == 0)
__elfN(parse_modmetadata)(struct preloaded_file *fp, elf_file_t ef)
if (__elfN(lookup_symbol)(fp, ef, "__start_set_modmetadata_set", &sym) != 0)
if (__elfN(lookup_symbol)(fp, ef, "__stop_set_modmetadata_set", &sym) != 0)
error = __elfN(reloc_ptr)(fp, ef, p, &v, sizeof(v));
error = __elfN(reloc_ptr)(fp, ef, v, &md64, sizeof(md64));
error = __elfN(reloc_ptr)(fp, ef, v, &md, sizeof(md));
__elfN(lookup_symbol)(struct preloaded_file *fp, elf_file_t ef, const char* name,
static int __elfN(loadimage)(struct preloaded_file *mp, elf_file_t ef, u_int64_t loadaddr);
__elfN(reloc_ptr)(struct preloaded_file *mp, elf_file_t ef,
static int __elfN(lookup_symbol)(struct preloaded_file *mp, elf_file_t ef, const char* name, Elf_Sym* sym);
static int __elfN(reloc_ptr)(struct preloaded_file *mp, elf_file_t ef,
error = __elfN(reloc)(ef, __elfN(symaddr), &r, ELF_RELOC_REL,
error = __elfN(reloc)(ef, __elfN(symaddr), &a, ELF_RELOC_RELA,
__elfN(symaddr)(struct elf_file *ef, Elf_Size symidx)
static int __elfN(parse_modmetadata)(struct preloaded_file *mp, elf_file_t ef);
static symaddr_fn __elfN(symaddr);
const char *__elfN(kerneltype) = "elf kernel";
const char *__elfN(moduletype) = "elf module";
u_int64_t __elfN(relocation_offset) = 0;
__elfN(loadfile)(char *filename, u_int64_t dest, struct preloaded_file **result)
if (strcmp(__elfN(obj_kerneltype), kfp->f_type)) {
fp->f_type = strdup(__elfN(obj_moduletype));
fp->f_size = __elfN(obj_loadimage)(fp, &ef, dest);
__elfN(obj_loadimage)(struct preloaded_file *fp, elf_file_t ef, u_int64_t off)
res = __elfN(obj_parse_modmetadata)(fp, ef);
__elfN(obj_parse_modmetadata)(struct preloaded_file *fp, elf_file_t ef)
if (__elfN(obj_lookup_set)(fp, ef, "modmetadata_set", &p, &p_stop,
error = __elfN(obj_reloc_ptr)(fp, ef, p, &v, sizeof(v));
error = __elfN(obj_reloc_ptr)(fp, ef, v, &md64, sizeof(md64));
error = __elfN(obj_reloc_ptr)(fp, ef, v, &md, sizeof(md));
__elfN(obj_lookup_set)(struct preloaded_file *fp, elf_file_t ef,
__elfN(obj_reloc_ptr)(struct preloaded_file *mp, elf_file_t ef, Elf_Addr p,
error = __elfN(reloc)(ef, __elfN(obj_symaddr),
error = __elfN(reloc)(ef, __elfN(obj_symaddr),
__elfN(obj_symaddr)(struct elf_file *ef, Elf_Size symidx)
static int __elfN(obj_loadimage)(struct preloaded_file *mp, elf_file_t ef,
static int __elfN(obj_lookup_set)(struct preloaded_file *mp, elf_file_t ef,
static int __elfN(obj_reloc_ptr)(struct preloaded_file *mp, elf_file_t ef,
static int __elfN(obj_parse_modmetadata)(struct preloaded_file *mp,
static Elf_Addr __elfN(obj_symaddr)(struct elf_file *ef, Elf_Size symidx);
const char *__elfN(obj_kerneltype) = "elf kernel";
const char *__elfN(obj_moduletype) = "elf obj module";
__elfN(obj_loadfile)(char *filename, u_int64_t dest,
__elfN(reloc)(struct elf_file *ef, symaddr_fn *symaddr, const void *reldata,
.sv_fixup = __elfN(dragonfly_fixup),
.sv_coredump = __elfN(coredump),
__elfN(puthdr)(lp, &target, sig, DRYRUN, seginfo.count, fp);
error = __elfN(corehdr)(lp, sig, fp, cred, seginfo.count, &target);
phdr->p_flags = __elfN(untrans_prot)(entry->protection);
__elfN(corehdr)(struct lwp *lp, int sig, struct file *fp, struct ucred *cred,
Elf_Brandnote __elfN(dragonfly_brandnote) = {
error = __elfN(puthdr)(lp, target, sig, WRITE, numsegs, fp);
__elfN(puthdr)(struct lwp *lp, elf_buf_t target, int sig, enum putmode mode,
.trans_osrel = __elfN(bsd_trans_osrel),
__elfN(putnote)(target, "CORE", NT_PRPSINFO, psinfo, sizeof *psinfo);
__elfN(putnote)(target, "CORE", NT_PRSTATUS, status, sizeof *status);
__elfN(putnote)(target, "CORE", NT_FPREGSET, fpregs, sizeof *fpregs);
error = __elfN(putnote)(target, "CORE", NT_PRSTATUS,
error = __elfN(putnote)(target, "CORE", NT_FPREGSET,
__elfN(putnote)(elf_buf_t target, const char *name, int type,
__elfN(check_note)(struct image_params *imgp, Elf_Brandnote *checknote,
__elfN(bsd_trans_osrel)(const Elf_Note *note, int32_t *osrel)
__elfN(load_section)(struct proc *p, struct vmspace *vmspace, struct vnode *vp,
__elfN(load_file)(struct proc *p, const char *file, u_long *addr, u_long *entry)
if ((error = __elfN(check_header)(hdr)) != 0)
prot = __elfN(trans_prot)(phdr[i].p_flags);
error = __elfN(load_section)(
__elfN(get_brandinfo)(struct image_params *imgp, const char *interp,
ret = __elfN(check_note)(imgp, bi->brand_note, osrel);
__elfN(fallback_brand) == bi->brand)
__CONCAT(exec_,__elfN(imgact))(struct image_params *imgp)
if (__elfN(check_header)(hdr) != 0 ||
brand_info = __elfN(get_brandinfo)(imgp, interp, &osrel);
prot = __elfN(trans_prot)(phdr[i].p_flags);
if ((error = __elfN(load_section)(
static int __elfN(check_header)(const Elf_Ehdr *hdr);
static Elf_Brandinfo *__elfN(get_brandinfo)(struct image_params *imgp,
static int __elfN(load_file)(struct proc *p, const char *file, u_long *addr,
static int __elfN(load_section)(struct proc *p,
error = __elfN(load_file)(imgp->proc, path, &addr,
error = __elfN(load_file)(imgp->proc, newinterp,
error = __elfN(load_file)(imgp->proc, interp, &addr,
static int __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp);
static boolean_t __elfN(bsd_trans_osrel)(const Elf_Note *note,
__elfN(dragonfly_fixup)(register_t **stack_base, struct image_params *imgp)
static boolean_t __elfN(check_note)(struct image_params *imgp,
static vm_prot_t __elfN(trans_prot)(Elf_Word);
static Elf_Word __elfN(untrans_prot)(vm_prot_t);
static int __elfN(corehdr)(struct lwp *, int, struct file *, struct ucred *,
static int __elfN(puthdr)(struct lwp *, elf_buf_t, int sig, enum putmode,
static int __elfN(putnote)(elf_buf_t, const char *, int, const void *, size_t);
__elfN(coredump)(struct lwp *lp, int sig, struct vnode *vp, off_t limit)
static int __elfN(fallback_brand) = -1;
int __elfN(brand_inuse) (Elf_Brandinfo *entry);
int __elfN(insert_brand_entry) (Elf_Brandinfo *entry);
int __elfN(remove_brand_entry) (Elf_Brandinfo *entry);
int __elfN(dragonfly_fixup) (register_t **, struct image_params *);
int __elfN(coredump) (struct lwp *, int, struct vnode *, off_t);
extern Elf_Brandnote __elfN(dragonfly_brandnote);