/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
/* Get the x86 version of the relocation engine */
#define DO_RELOC_LIBLD_X86
#include <string.h>
#include <stdio.h>
#include <strings.h>
#include <sys/elf_amd64.h>
#include <debug.h>
#include <reloc.h>
#include <i386/machdep_x86.h>
#include "msg.h"
#include "_libld.h"
/*
* This module uses do_reloc_ld() to execute several synthesized relocations.
* That function expects to be passed two things that we need to construct
* here:
*
* 1) A Rel_desc descriptor for each relocation type, from which the
* rel_rtype field, and nothing else, is obtained. This is easily
* handled by constructing the necessary descriptors.
*
* 2) A function, which called with the Rel_desc descriptor, returns
* a string representing the name of the symbol associated with
* the descriptor. The usual function for this is ld_reloc_sym_name().
* However, that function will not work in this case, as these synthetic
* relocations do not have an associated symbol. We supply the
* syn_rdesc_sym_name() function to simply return the fixed name.
*/
/*ARGSUSED*/
static const char *
{
return (MSG_ORIG(MSG_SYM_PLTENT));
}
/*
* Search the GOT index list for a GOT entry with a matching reference and the
* proper addend.
*/
static Gotndx *
{
return (ofl->ofl_tlsldgotndx);
return (gnp);
}
}
return (NULL);
}
static Xword
{
else
gotndx++;
}
static Word
{
/* LINTED */
*typedata = 0;
}
static void
{
}
static void
{
/*
* Create this entry if we are going to create a PLT table.
*/
if (ofl->ofl_pltcnt)
(*cnt)++; /* DT_PLTGOT */
}
}
static void
{
else
(*dyn)++;
}
}
static Xword
{
return (value);
}
/*
* Build a single plt entry - code is:
* JMP *name1@GOTPCREL(%rip)
* PUSHL $index
* JMP .PLT0
*/
/* 0x00 jmpq *name1@GOTPCREL(%rip) */ 0xff, 0x25, 0x00, 0x00, 0x00, 0x00,
/* 0x06 pushq $index */ 0x68, 0x00, 0x00, 0x00, 0x00,
/* 0x0b jmpq .plt0(%rip) */ 0xe9, 0x00, 0x00, 0x00, 0x00
/* 0x10 */
};
static uintptr_t
{
/*
* Fill in the got entry with the address of the next instruction.
*/
/* LINTED */
if (bswap)
/* LINTED */
/*
* If '-z noreloc' is specified - skip the do_reloc_ld
* stage.
*/
if (!OFL_DO_RELOC(ofl))
return (1);
/*
* patchup:
* jmpq *name1@gotpcrel(%rip)
*
* NOTE: 0x06 represents next instruction.
*/
return (S_ERROR);
}
/*
* patchup:
* pushq $pltndx
*/
return (S_ERROR);
}
/*
* patchup:
* jmpq .plt0(%rip)
* NOTE: 0x10 represents next instruction. The rather complex
* series of casts is necessary to sign extend an offset into
* a 64-bit value while satisfying various compiler error
* checks. Handle with care.
*/
return (S_ERROR);
}
return (1);
}
static uintptr_t
{
char *relbits;
int sectmoved = 0;
/*
* If the section this relocation is against has been discarded
* (-zignore), then also discard (skip) the relocation itself.
*/
return (1);
}
/*
* If this is a relocation against a move table, or expanded move
* table, adjust the relocation entries.
*/
if (RELAUX_GET_MOVE(orsp))
/*
* If this is a relocation against a section then we need to adjust the
* raddend field to compensate for the new position of the input section
* within the new output section.
*/
if (ofl->ofl_parsyms &&
/* LINTED */
sectmoved = 1;
else
/* LINTED */
raddend +=
} else {
/* LINTED */
raddend +=
}
}
/*
* Note: for GOT relative relocations on amd64
* we discard the addend. It was relevant
* to the reference - not to the data item
* being referenced (ie: that -4 thing).
*/
raddend = 0;
/*
* Note that relocations for PLT's actually
* cause a relocation againt the GOT.
*/
raddend = 0;
return (S_ERROR);
/*
* This must be a R_AMD64_COPY. For these set the roffset to
* point to the new symbols location.
*/
/*
* The raddend doesn't mean anything in a R_SPARC_COPY
* relocation. Null it out because it can confuse people.
*/
raddend = 0;
} else {
/*
* Calculate virtual offset of reference point; equals offset
* into section + vaddr of section for loadable sections, or
* offset plus section displacement for nonloadable sections.
*/
}
/*
* Assign the symbols index for the output relocation. If the
* relocation refers to a SECTION symbol then it's index is based upon
* the output sections symbols index. Otherwise the index can be
* derived from the symbols index itself.
*/
if (sectmoved == 0) {
/*
* Check for a null input section. This can
* occur if this relocation references a symbol
* generated by sym_add_sym().
*/
else
} else
} else
/*
* Add the symbols 'value' to the addend field.
*/
/*
* The addend field for R_AMD64_DTPMOD64 means nothing. The addend
* is propagated in the corresponding R_AMD64_DTPOFF64 relocation.
*/
raddend = 0;
/*
* Assert we haven't walked off the end of our relocation table.
*/
/*
* Determine if this relocation is against a non-writable, allocatable
* section. If so we may need to provide a text relocation diagnostic.
* Note that relocations against the .plt (R_AMD64_JUMP_SLOT) actually
* result in modifications to the .got.
*/
return (1);
}
/*
* amd64 Instructions for TLS processing
*/
/*
* 0x00 movq %fs:0, %rax
*/
0x64, 0x48, 0x8b, 0x04, 0x25,
0x00, 0x00, 0x00, 0x00,
/*
* 0x09 addq x@gottpoff(%rip), %rax
*/
0x48, 0x03, 0x05, 0x00, 0x00,
0x00, 0x00
};
/*
* 0x00 movq %fs:0, %rax
*/
0x64, 0x48, 0x8b, 0x04, 0x25,
0x00, 0x00, 0x00, 0x00,
/*
* 0x09 leaq x@gottpoff(%rip), %rax
*/
0x48, 0x8d, 0x80, 0x00, 0x00,
0x00, 0x00
};
/*
* .byte 0x66
*/
0x66,
/*
* .byte 0x66
*/
0x66,
/*
* .byte 0x66
*/
0x66,
/*
* movq %fs:0, %rax
*/
0x64, 0x48, 0x8b, 0x04, 0x25,
0x00, 0x00, 0x00, 0x00
};
static Fixupret
{
/*
* Note that in certain of the original insn sequences below, the
* instructions are not necessarily adjacent
*/
/*
* IE reference model
*/
switch (rtype) {
case R_AMD64_TLSGD:
/*
* GD -> IE
*
* Transition:
* 0x00 .byte 0x66
* 0x01 leaq x@tlsgd(%rip), %rdi
* 0x08 .word 0x6666
* 0x0a rex64
* 0x0b call __tls_get_addr@plt
* 0x10
* To:
* 0x00 movq %fs:0, %rax
* 0x09 addq x@gottpoff(%rip), %rax
* 0x10
*/
/*
* Adjust 'offset' to beginning of instruction
* sequence.
*/
offset -= 4;
sizeof (tlsinstr_gd_ie));
return (FIX_RELOC);
case R_AMD64_PLT32:
/*
* Fixup done via the TLS_GD relocation.
*/
return (FIX_DONE);
}
}
/*
* LE reference model
*/
switch (rtype) {
case R_AMD64_TLSGD:
/*
* GD -> LE
*
* Transition:
* 0x00 .byte 0x66
* 0x01 leaq x@tlsgd(%rip), %rdi
* 0x08 .word 0x6666
* 0x0a rex64
* 0x0b call __tls_get_addr@plt
* 0x10
* To:
* 0x00 movq %fs:0, %rax
* 0x09 leaq x@tpoff(%rax), %rax
* 0x10
*/
arsp->rel_raddend = 0;
/*
* Adjust 'offset' to beginning of instruction sequence.
*/
offset -= 4;
return (FIX_RELOC);
case R_AMD64_GOTTPOFF: {
/*
* IE -> LE
*
* Transition 1:
* movq %fs:0, %reg
* addq x@gottpoff(%rip), %reg
* To:
* movq %fs:0, %reg
* leaq x@tpoff(%reg), %reg
*
* Transition (as a special case):
* movq %fs:0, %r12/%rsp
* addq x@gottpoff(%rip), %r12/%rsp
* To:
* movq %fs:0, %r12/%rsp
* addq x@tpoff(%rax), %r12/%rsp
*
* Transition 2:
* movq x@gottpoff(%rip), %reg
* movq %fs:(%reg), %reg
* To:
* movq x@tpoff(%reg), %reg
* movq %fs:(%reg), %reg
*/
offset -= 3;
arsp->rel_raddend = 0;
/*
* This is transition 2, and the special case of form 1 where
* a normal transition would index %rsp or %r12 and need a SIB
* byte in the leaq for which we lack space
*/
/*
* If we needed an extra bit of MOD.reg to refer to
* this register as the dest of the original movq we
* need an extra bit of MOD.rm to refer to it in the
* dest of the replacement movq or addq.
*/
return (FIX_RELOC);
/*
* If we needed an extra bit of MOD.reg to refer to
* this register in the dest of the addq we need an
* extra bit of both MOD.reg and MOD.rm to refer to it
* in the source and dest of the leaq
*/
return (FIX_RELOC);
}
return (FIX_ERROR);
}
case R_AMD64_TLSLD:
/*
* LD -> LE
*
* Transition
* 0x00 leaq x1@tlsgd(%rip), %rdi
* 0x07 call __tls_get_addr@plt
* 0x0c
* To:
* 0x00 .byte 0x66
* 0x01 .byte 0x66
* 0x02 .byte 0x66
* 0x03 movq %fs:0, %rax
*/
offset -= 3;
return (FIX_DONE);
case R_AMD64_DTPOFF32:
/*
* LD->LE
*
* Transition:
* 0x00 leaq x1@dtpoff(%rax), %rcx
* To:
* 0x00 leaq x1@tpoff(%rax), %rcx
*/
arsp->rel_raddend = 0;
return (FIX_RELOC);
}
return (FIX_RELOC);
}
static uintptr_t
{
/*
* Process active relocations.
*/
const char *ifl_name;
int moved = 0;
/*
* If the section this relocation is against has been discarded
* (-zignore), then discard (skip) the relocation itself.
*/
FLG_REL_PLT | FLG_REL_NOINFO)) == 0)) {
continue;
}
/*
* We determine what the 'got reference' model (if required)
* is at this point. This needs to be done before tls_fixup()
* since it may 'transition' our instructions.
*
* The got table entries have already been assigned,
* and we bind to those initial entries.
*/
else
/*
* Perform any required TLS fixups.
*/
return (S_ERROR);
continue;
}
/*
* If this is a relocation against a move table, or
* expanded move table, adjust the relocation entries.
*/
if (RELAUX_GET_MOVE(arsp))
value = 0;
/*
* The value for a symbol pointing to a SECTION
* is based off of that sections position.
*/
/* LINTED */
/*
* The symbol was moved, so adjust the value
* relative to the new section.
*/
moved = 1;
/*
* The original raddend covers the displacement
* from the section start to the desired
* address. The value computed above gets us
* from the section start to the start of the
* symbol range. Adjust the old raddend to
* remove the offset from section start to
* symbol start, leaving the displacement
* within the range of the symbol.
*/
} else {
}
/*
* Size relocations require the symbols size.
*/
/*
* If relocation is against a capabilities symbol, we
* need to jump to an associated PLT, so that at runtime
* ld.so.1 is involved to determine the best binding
* choice. Otherwise, the value is the symbols value.
*/
} else
/*
* Relocation against the GLOBAL_OFFSET_TABLE.
*/
return (S_ERROR);
/*
* If loadable and not producing a relocatable object add the
* sections virtual address to the reference address.
*/
((flags & FLG_OF_RELOBJ) == 0))
/*
* If this entry has a PLT assigned to it, its value is actually
* the address of the PLT (and not the address of the function).
*/
}
/*
* Add relocations addend to value. Add extra
* relocation addend if needed.
*
* Note: For GOT relative relocations on amd64 we discard the
* addend. It was relevant to the reference - not to the
* data item being referenced (ie: that -4 thing).
*/
/*
* Determine whether the value needs further adjustment. Filter
* through the attributes of the relocation to determine what
* adjustment is required. Note, many of the following cases
* are only applicable when a .got is present. As a .got is
* not generated when a relocatable object is being built,
* any adjustments that require a .got need to be skipped.
*/
((flags & FLG_OF_RELOBJ) == 0)) {
/*
* Perform relocation against GOT table. Since this
* doesn't fit exactly into a relocation we place the
* appropriate byte in the GOT directly
*
* Calculate offset into GOT at which to apply
* the relocation.
*/
else
/*
* Add the GOTs data's offset.
*/
/*
* And do it.
*/
else
continue;
((flags & FLG_OF_RELOBJ) == 0)) {
((flags & FLG_OF_RELOBJ) == 0)) {
/*
* Calculation:
* G + GOT + A - P
*/
((flags & FLG_OF_RELOBJ) == 0)) {
(((flags & FLG_OF_RELOBJ) == 0) ||
((flags & FLG_OF_RELOBJ) == 0)) {
((flags & FLG_OF_RELOBJ) == 0)) {
((flags & FLG_OF_RELOBJ) == 0)) {
/*
* This is the LE TLS reference model. Static
* offset is hard-coded.
*/
/*
* Since this code is fixed up, it assumes a negative
* offset that can be added to the thread pointer.
*/
}
else
/*
* Make sure we have data to relocate. Compiler and assembler
* developers have been known to generate relocations against
* invalid sections (normally .bss), so for their benefit give
* them sufficient information to help analyze the problem.
* End users should never see this.
*/
return (S_ERROR);
}
/*
* Get the address of the data item we need to modify.
*/
int class;
else
class = ERR_WARNING;
continue;
}
}
/*
* The relocation is additive. Ignore the previous symbol
* value if this local partial symbol is expanded.
*/
if (moved)
/*
* If '-z noreloc' is specified - skip the do_reloc_ld stage.
*/
if (OFL_DO_RELOC(ofl)) {
/*
* If this is a PROGBITS section and the running linker
* has a different byte order than the target host,
* tell do_reloc_ld() to swap bytes.
*/
}
}
}
return (return_code);
}
static uintptr_t
{
/*
* Static executables *do not* want any relocations against them.
* Since our engine still creates relocations against a WEAK UNDEFINED
* symbol in a static executable, it's best to disable them here
* instead of through out the relocation code.
*/
if (OFL_IS_STATIC_EXEC(ofl))
return (1);
/*
* If we are adding a output relocation against a section
* symbol (non-RELATIVE) then mark that section. These sections
* will be added to the .dynsym symbol table.
*/
((flags & FLG_REL_SCNNDX) ||
/*
* If this is a COMMON symbol - no output section
* exists yet - (it's created as part of sym_validate()).
* So - we mark here that when it's created it should
* be tagged with the FLG_OS_OUTREL flag.
*/
else
} else {
ofl->ofl_dynshdrcnt++;
}
}
}
/* Enter it into the output relocation cache */
return (S_ERROR);
if (flags & FLG_REL_GOT)
else if (flags & FLG_REL_PLT)
else if (flags & FLG_REL_BSS)
else if (flags & FLG_REL_NOINFO)
else
ofl->ofl_relocrelcnt++;
/*
* We don't perform sorting on PLT relocations because
* they have already been assigned a PLT index and if we
* were to sort them we would have to re-assign the plt indexes.
*/
if (!(flags & FLG_REL_PLT))
ofl->ofl_reloccnt++;
/*
* Insure a GLOBAL_OFFSET_TABLE is generated if required.
*/
/*
* Identify and possibly warn of a displacement relocation.
*/
}
return (1);
}
/*
* process relocation for a LOCAL symbol
*/
static uintptr_t
{
/*
* if ((shared object) and (not pc relative relocation) and
* (not against ABS symbol))
* then
* build R_AMD64_RELATIVE
* fi
*/
/*
* R_AMD64_RELATIVE updates a 64bit address, if this
* relocation isn't a 64bit binding then we can not
* simplify it to a RELATIVE relocation.
*/
}
return (S_ERROR);
return (1);
}
/*
* If the relocation is against a 'non-allocatable' section
* and we can not resolve it now - then give a warning
* message.
*
* We can not resolve the symbol if either:
* a) it's undefined
* b) it's defined in a shared library and a
* COPY relocation hasn't moved it to the executable
*
* Note: because we process all of the relocations against the
* text segment before any others - we know whether
* or not a copy relocation will be generated before
* we get here (see reloc_init()->reloc_segments()).
*/
/*
* If the relocation is against a SHT_SUNW_ANNOTATE
* section - then silently ignore that the relocation
* can not be resolved.
*/
return (0);
return (1);
}
/*
* Perform relocation.
*/
}
static uintptr_t
{
/*
* If we're building an executable - use either the IE or LE access
* model. If we're building a shared object process any IE model.
*/
/*
* Set the DF_STATIC_TLS flag.
*/
/*
* Assign a GOT entry for static TLS references.
*/
return (S_ERROR);
}
/*
* IE access model.
*/
/*
* Fixups are required for other executable models.
*/
}
/*
* LE access model.
*/
}
/*
* Building a shared object.
*
* Assign a GOT entry for a dynamic TLS reference.
*/
return (S_ERROR);
R_AMD64_DTPOFF64) == S_ERROR)
return (S_ERROR);
}
}
/* ARGSUSED5 */
static uintptr_t
{
return (1);
gotents = 2;
else
gotents = 1;
if (gref == GOT_REF_TLSLD) {
return (S_ERROR);
}
return (1);
}
idx = 0;
break;
}
/*
* GOT indexes are maintained on an Alist, where there is typically
* only one index. The usage of this list is to scan the list to find
* an index, and then apply that index immediately to a relocation.
* Thus there are no external references to these GOT index structures
* that can be compromised by the Alist being reallocated.
*/
return (S_ERROR);
return (1);
}
static void
{
}
/* 0x00 PUSHQ GOT+8(%rip) */ 0xff, 0x35, 0x00, 0x00, 0x00, 0x00,
/* 0x06 JMP *GOT+16(%rip) */ 0xff, 0x25, 0x00, 0x00, 0x00, 0x00,
/* 0x0c NOP */ 0x90,
/* 0x0d NOP */ 0x90,
/* 0x0e NOP */ 0x90,
/* 0x0f NOP */ 0x90
};
/*
* Initializes .got[0] with the _DYNAMIC symbol value.
*/
static uintptr_t
{
(M_GOT_XDYNAMIC * M_GOT_ENTSIZE));
/* LINTED */
if (bswap)
/* LINTED */
/* LINTED */
}
}
/*
* Fill in the reserved slot in the procedure linkage table the first
* entry is:
* 0x00 PUSHQ GOT+8(%rip) # GOT[1]
* 0x06 JMP *GOT+16(%rip) # GOT[2]
* 0x0c NOP
* 0x0d NOP
* 0x0e NOP
* 0x0f NOP
*/
/*
* If '-z noreloc' is specified - skip the do_reloc_ld
* stage.
*/
if (!OFL_DO_RELOC(ofl))
return (1);
/*
* filin:
* PUSHQ GOT + 8(%rip)
*
* Note: 0x06 below represents the offset to the
* next instruction - which is what %rip will
* be pointing at.
*/
(M_GOT_XLINKMAP * M_GOT_ENTSIZE) -
return (S_ERROR);
}
/*
* filin:
* JMP *GOT+16(%rip)
*/
(M_GOT_XRTLD * M_GOT_ENTSIZE) -
return (S_ERROR);
}
}
return (1);
}
/*
* Template for generating "void (*)(void)" function
*/
/* 0x00 */ 0x55, /* pushq %rbp */
/* 0x01 */ 0x48, 0x8b, 0xec, /* movq %rsp,%rbp */
/* 0x04 */ 0x48, 0x8b, 0xe5, /* movq %rbp,%rsp */
/* 0x07 */ 0x5d, /* popq %rbp */
/* 0x08 */ 0xc3 /* ret */
};
/*
* Function used to provide fill padding in SHF_EXECINSTR sections
*
* entry:
*
* base - base address of section being filled
* offset - starting offset for fill within memory referenced by base
* cnt - # bytes to be filled
*
* exit:
* The fill has been completed.
*/
static void
{
/*
* 0x90 is an X86 NOP instruction in both 32 and 64-bit worlds.
* There are no alignment constraints.
*/
}
/*
* Return the ld_targ definition for this target.
*/
const Target *
ld_targ_init_x86(void)
{
{ /* Target_mach */
M_MACH, /* m_mach */
M_MACHPLUS, /* m_machplus */
M_FLAGSPLUS, /* m_flagsplus */
M_CLASS, /* m_class */
M_DATA, /* m_data */
M_SEGM_ALIGN, /* m_segm_align */
M_SEGM_ORIGIN, /* m_segm_origin */
M_SEGM_AORIGIN, /* m_segm_aorigin */
M_DATASEG_PERM, /* m_dataseg_perm */
M_STACK_PERM, /* m_stack_perm */
M_WORD_ALIGN, /* m_word_align */
/* Relocation type codes */
M_R_ARRAYADDR, /* m_r_arrayaddr */
M_R_COPY, /* m_r_copy */
M_R_GLOB_DAT, /* m_r_glob_dat */
M_R_JMP_SLOT, /* m_r_jmp_slot */
M_R_NUM, /* m_r_num */
M_R_NONE, /* m_r_none */
M_R_RELATIVE, /* m_r_relative */
M_R_REGISTER, /* m_r_register */
/* Relocation related constants */
M_REL_DT_COUNT, /* m_rel_dt_count */
M_REL_DT_ENT, /* m_rel_dt_ent */
M_REL_DT_SIZE, /* m_rel_dt_size */
M_REL_DT_TYPE, /* m_rel_dt_type */
M_REL_SHT_TYPE, /* m_rel_sht_type */
/* GOT related constants */
M_GOT_ENTSIZE, /* m_got_entsize */
M_GOT_XNumber, /* m_got_xnumber */
/* PLT related constants */
M_PLT_ALIGN, /* m_plt_align */
M_PLT_ENTSIZE, /* m_plt_entsize */
M_PLT_RESERVSZ, /* m_plt_reservsz */
M_PLT_SHF_FLAGS, /* m_plt_shf_flags */
/* Section type of .eh_frame/.eh_frame_hdr sections */
SHT_AMD64_UNWIND, /* m_sht_unwind */
M_DT_REGISTER, /* m_dt_register */
},
{ /* Target_machid */
M_ID_ARRAY, /* id_array */
M_ID_BSS, /* id_bss */
M_ID_CAP, /* id_cap */
M_ID_CAPINFO, /* id_capinfo */
M_ID_CAPCHAIN, /* id_capchain */
M_ID_DATA, /* id_data */
M_ID_DYNAMIC, /* id_dynamic */
M_ID_DYNSORT, /* id_dynsort */
M_ID_DYNSTR, /* id_dynstr */
M_ID_DYNSYM, /* id_dynsym */
M_ID_DYNSYM_NDX, /* id_dynsym_ndx */
M_ID_GOT, /* id_got */
M_ID_UNKNOWN, /* id_gotdata (unused) */
M_ID_HASH, /* id_hash */
M_ID_INTERP, /* id_interp */
M_ID_LBSS, /* id_lbss */
M_ID_LDYNSYM, /* id_ldynsym */
M_ID_NOTE, /* id_note */
M_ID_NULL, /* id_null */
M_ID_PLT, /* id_plt */
M_ID_REL, /* id_rel */
M_ID_STRTAB, /* id_strtab */
M_ID_SYMINFO, /* id_syminfo */
M_ID_SYMTAB, /* id_symtab */
M_ID_SYMTAB_NDX, /* id_symtab_ndx */
M_ID_TEXT, /* id_text */
M_ID_TLS, /* id_tls */
M_ID_TLSBSS, /* id_tlsbss */
M_ID_UNKNOWN, /* id_unknown */
M_ID_UNWIND, /* id_unwind */
M_ID_UNWINDHDR, /* id_unwindhdr */
M_ID_USER, /* id_user */
M_ID_VERSION, /* id_version */
},
{ /* Target_nullfunc */
nullfunc_tmpl, /* nf_template */
sizeof (nullfunc_tmpl), /* nf_size */
},
{ /* Target_fillfunc */
execfill /* ff_execfill */
},
{ /* Target_machrel */
ld_init_rel, /* mr_init_rel */
ld_mach_eflags, /* mr_mach_eflags */
ld_mach_make_dynamic, /* mr_mach_make_dynamic */
ld_mach_update_odynamic, /* mr_mach_update_odynamic */
ld_calc_plt_addr, /* mr_calc_plt_addr */
ld_perform_outreloc, /* mr_perform_outreloc */
ld_do_activerelocs, /* mr_do_activerelocs */
ld_add_outrel, /* mr_add_outrel */
NULL, /* mr_reloc_register */
ld_reloc_local, /* mr_reloc_local */
NULL, /* mr_reloc_GOTOP */
ld_reloc_TLS, /* mr_reloc_TLS */
NULL, /* mr_assign_got */
ld_find_got_ndx, /* mr_find_got_ndx */
ld_calc_got_offset, /* mr_calc_got_offset */
ld_assign_got_ndx, /* mr_assign_got_ndx */
ld_assign_plt_ndx, /* mr_assign_plt_ndx */
NULL, /* mr_allocate_got */
ld_fillin_gotplt, /* mr_fillin_gotplt */
},
{ /* Target_machsym */
NULL, /* ms_reg_check */
NULL, /* ms_mach_sym_typecheck */
NULL, /* ms_is_regsym */
NULL, /* ms_reg_find */
NULL /* ms_reg_enter */
}
};
return (&_ld_targ);
}