/freebsd/libexec/rtld-elf/i386/ |
H A D | reloc.c | 65 const Elf_Rel *rel; in do_copy_relocations() local 69 rellim = (const Elf_Rel *)((const char *)dstobj->rel + dstobj->relsize); in do_copy_relocations() 70 for (rel = dstobj->rel; rel < rellim; rel++) { in do_copy_relocations() 71 if (ELF_R_TYPE(rel->r_info) == R_386_COPY) { in do_copy_relocations() 82 dstaddr = (void *)(dstobj->relocbase + rel->r_offset); in do_copy_relocations() 83 dstsym = dstobj->symtab + ELF_R_SYM(rel->r_info); in do_copy_relocations() 88 ELF_R_SYM(rel->r_info)); in do_copy_relocations() 134 const Elf_Rel *rel; in reloc_non_plt() local 157 rellim = (const Elf_Rel *)((const char *)obj->rel + obj->relsize); in reloc_non_plt() 158 for (rel = obj->rel; rel < rellim; rel++) { in reloc_non_plt() [all …]
|
/freebsd/sys/conf/ |
H A D | ldscript.i386 | 17 .rel.init : { *(.rel.init) } 19 .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } 21 .rel.fini : { *(.rel.fini) } 23 .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } 25 .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) } 26 .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) } 27 .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } 29 .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } 31 .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } 33 .rel.ctors : { *(.rel.ctors) } [all …]
|
H A D | ldscript.amd64 | 22 .rel.init : { *(.rel.init) } 24 .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } 26 .rel.fini : { *(.rel.fini) } 28 .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } 30 .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) } 31 .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) } 32 .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } 34 .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } 36 .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } 38 .rel.ctors : { *(.rel.ctors) } [all …]
|
H A D | ldscript.riscv | 35 .rel.text : 36 { *(.rel.text) *(.rel.gnu.linkonce.t*) } 39 .rel.data : 40 { *(.rel.data) *(.rel.gnu.linkonce.d*) } 43 .rel.rodata : 44 { *(.rel.rodata) *(.rel.gnu.linkonce.r*) } 47 .rel.got : { *(.rel.got) } 49 .rel.ctors : { *(.rel.ctors) } 51 .rel.dtors : { *(.rel.dtors) } 53 .rel.init : { *(.rel.init) } [all …]
|
H A D | ldscript.arm | 34 .rel.text : 35 { *(.rel.text) *(.rel.gnu.linkonce.t*) } 38 .rel.data : 39 { *(.rel.data) *(.rel.gnu.linkonce.d*) } 42 .rel.rodata : 43 { *(.rel.rodata) *(.rel.gnu.linkonce.r*) } 46 .rel.got : { *(.rel.got) } 48 .rel.ctors : { *(.rel.ctors) } 50 .rel.dtors : { *(.rel.dtors) } 52 .rel.init : { *(.rel.init) } [all …]
|
H A D | ldscript.arm64 | 36 .rel.text : 37 { *(.rel.text) *(.rel.gnu.linkonce.t*) } 40 .rel.data : 41 { *(.rel.data) *(.rel.gnu.linkonce.d*) } 44 .rel.rodata : 45 { *(.rel.rodata) *(.rel.gnu.linkonce.r*) } 48 .rel.got : { *(.rel.got) } 50 .rel.ctors : { *(.rel.ctors) } 52 .rel.dtors : { *(.rel.dtors) } 54 .rel.init : { *(.rel.init) } [all …]
|
/freebsd/libexec/rtld-elf/arm/ |
H A D | reloc.c | 32 const Elf_Rel *rel; in do_copy_relocations() local 36 rellim = (const Elf_Rel *)((const char *) dstobj->rel + dstobj->relsize); in do_copy_relocations() 37 for (rel = dstobj->rel; rel < rellim; rel++) { in do_copy_relocations() 38 if (ELF_R_TYPE(rel->r_info) == R_ARM_COPY) { in do_copy_relocations() 49 dstaddr = (void *)(dstobj->relocbase + rel->r_offset); in do_copy_relocations() 50 dstsym = dstobj->symtab + ELF_R_SYM(rel->r_info); in do_copy_relocations() 56 ELF_R_SYM(rel->r_info)); in do_copy_relocations() 89 const Elf_Rel *rel = NULL, *rellim; in _rtld_relocate_nonplt_self() local 96 rel = (const Elf_Rel *)(relocbase + dynp->d_un.d_ptr); in _rtld_relocate_nonplt_self() 103 rellim = (const Elf_Rel *)((const char *)rel + relsz); in _rtld_relocate_nonplt_self() [all …]
|
/freebsd/contrib/llvm-project/lld/ELF/Arch/ |
H A D | AVR.cpp | 53 void relocate(uint8_t *loc, const Relocation &rel, 119 void AVR::relocate(uint8_t *loc, const Relocation &rel, uint64_t val) const { in relocate() argument 120 switch (rel.type) { in relocate() 122 checkUInt(loc, val, 8, rel); in relocate() 126 checkUInt(loc, val, 32, rel); in relocate() 130 checkUInt(loc, val, 32, rel); in relocate() 134 checkUInt(loc, val, 32, rel); in relocate() 144 checkAlignment(loc, val, 2, rel); in relocate() 145 checkUInt(loc, val >> 1, 16, rel); in relocate() 149 checkUInt(loc, val, 32, rel); in relocate() [all …]
|
H A D | AArch64.cpp | 50 void relocate(uint8_t *loc, const Relocation &rel, 56 void relaxTlsGdToLe(uint8_t *loc, const Relocation &rel, uint64_t val) const; 57 void relaxTlsGdToIe(uint8_t *loc, const Relocation &rel, uint64_t val) const; 58 void relaxTlsIeToLe(uint8_t *loc, const Relocation &rel, uint64_t val) const; 449 void AArch64::relocate(uint8_t *loc, const Relocation &rel, in relocate() argument 451 switch (rel.type) { in relocate() 454 checkIntUInt(loc, val, 16, rel); in relocate() 459 checkIntUInt(loc, val, 32, rel); in relocate() 464 checkInt(loc, val, 32, rel); in relocate() 475 if (rel.sym && rel.sym->isTagged() && in relocate() [all …]
|
H A D | X86_64.cpp | 40 void relocate(uint8_t *loc, const Relocation &rel, 329 for (Relocation &rel : sec->relocs()) { in relaxOnce() 330 if (rel.expr != R_RELAX_GOT_PC && rel.expr != R_RELAX_GOT_PC_NOPIC) in relaxOnce() 332 assert(rel.addend == -4); in relaxOnce() 335 sec->file, rel.type, rel.expr == R_RELAX_GOT_PC_NOPIC ? 0 : -4, in relaxOnce() 336 sec->getOutputSection()->addr + sec->outSecOff + rel.offset, in relaxOnce() 337 *rel.sym, rel.expr); in relaxOnce() 340 if (rel.sym->auxIdx == 0) { in relaxOnce() 341 rel.sym->allocateAux(); in relaxOnce() 342 addGotEntry(*rel.sym); in relaxOnce() [all …]
|
H A D | PPC.cpp | 50 void relocate(uint8_t *loc, const Relocation &rel, 57 void relaxTlsGdToIe(uint8_t *loc, const Relocation &rel, uint64_t val) const; 58 void relaxTlsGdToLe(uint8_t *loc, const Relocation &rel, uint64_t val) const; 59 void relaxTlsLdToLe(uint8_t *loc, const Relocation &rel, uint64_t val) const; 60 void relaxTlsIeToLe(uint8_t *loc, const Relocation &rel, uint64_t val) const; 317 void PPC::relocate(uint8_t *loc, const Relocation &rel, uint64_t val) const { in relocate() 319 std::tie(newType, val) = fromDTPREL(rel.type, val); in relocate() 322 checkIntUInt(loc, val, 16, rel); in relocate() 330 checkInt(loc, val, 16, rel); in relocate() 366 checkInt(loc, val, 16, rel); in relocate() 310 relocate(uint8_t * loc,const Relocation & rel,uint64_t val) const relocate() argument 401 relaxTlsGdToIe(uint8_t * loc,const Relocation & rel,uint64_t val) const relaxTlsGdToIe() argument 420 relaxTlsGdToLe(uint8_t * loc,const Relocation & rel,uint64_t val) const relaxTlsGdToLe() argument 436 relaxTlsLdToLe(uint8_t * loc,const Relocation & rel,uint64_t val) const relaxTlsLdToLe() argument 460 relaxTlsIeToLe(uint8_t * loc,const Relocation & rel,uint64_t val) const relaxTlsIeToLe() argument 493 for (const Relocation &rel : sec.relocs()) { relocateAlloc() local [all...] |
H A D | PPC64.cpp | 183 void relocate(uint8_t *loc, const Relocation &rel, 194 void relaxGot(uint8_t *loc, const Relocation &rel, uint64_t val) const; 201 void relaxTlsGdToIe(uint8_t *loc, const Relocation &rel, uint64_t val) const; 202 void relaxTlsGdToLe(uint8_t *loc, const Relocation &rel, uint64_t val) const; 203 void relaxTlsLdToLe(uint8_t *loc, const Relocation &rel, uint64_t val) const; 204 void relaxTlsIeToLe(uint8_t *loc, const Relocation &rel, uint64_t val) const; 380 static bool tryRelaxPPC64TocIndirection(const Relocation &rel, in tryRelaxPPC64TocIndirection() argument 383 if (rel.addend < 0) in tryRelaxPPC64TocIndirection() 387 Defined *defSym = dyn_cast<Defined>(rel.sym); in tryRelaxPPC64TocIndirection() 395 config->isLE ? getRelaTocSymAndAddend<ELF64LE>(tocISB, rel.addend) in tryRelaxPPC64TocIndirection() [all …]
|
H A D | X86.cpp | 37 void relocate(uint8_t *loc, const Relocation &rel, 283 void X86::relocate(uint8_t *loc, const Relocation &rel, uint64_t val) const { in relocate() argument 284 switch (rel.type) { in relocate() 289 checkIntUInt(loc, val, 8, rel); in relocate() 293 checkInt(loc, val, 8, rel); in relocate() 297 checkIntUInt(loc, val, 16, rel); in relocate() 311 checkInt(loc, val, 17, rel); in relocate() 335 checkInt(loc, val, 32, rel); in relocate() 347 static void relaxTlsGdToLe(uint8_t *loc, const Relocation &rel, uint64_t val) { in relaxTlsGdToLe() argument 348 if (rel.type == R_386_TLS_GD) { in relaxTlsGdToLe() [all …]
|
H A D | MSP430.cpp | 37 void relocate(uint8_t *loc, const Relocation &rel, 62 void MSP430::relocate(uint8_t *loc, const Relocation &rel, uint64_t val) const { in relocate() argument 63 switch (rel.type) { in relocate() 65 checkIntUInt(loc, val, 8, rel); in relocate() 72 checkIntUInt(loc, val, 16, rel); in relocate() 76 checkIntUInt(loc, val, 32, rel); in relocate() 81 checkInt(loc, offset, 10, rel); in relocate() 87 toString(rel.type)); in relocate()
|
H A D | SPARCV9.cpp | 29 void relocate(uint8_t *loc, const Relocation &rel, 87 void SPARCV9::relocate(uint8_t *loc, const Relocation &rel, in relocate() argument 89 switch (rel.type) { in relocate() 93 checkUInt(loc, val, 32, rel); in relocate() 98 checkInt(loc, val, 32, rel); in relocate() 104 checkInt(loc, val, 32, rel); in relocate() 109 checkUInt(loc, val, 22, rel); in relocate() 120 checkUInt(loc, val >> 10, 22, rel); in relocate() 125 checkInt(loc, val, 21, rel); in relocate() 144 checkUInt(loc, val >> 42, 22, rel); in relocate() [all …]
|
H A D | RISCV.cpp | 44 void relocate(uint8_t *loc, const Relocation &rel, 335 void RISCV::relocate(uint8_t *loc, const Relocation &rel, uint64_t val) const { in relocate() argument 338 switch (rel.type) { in relocate() 347 checkInt(loc, val, 9, rel); in relocate() 348 checkAlignment(loc, val, 2, rel); in relocate() 362 checkInt(loc, val, 12, rel); in relocate() 363 checkAlignment(loc, val, 2, rel); in relocate() 381 checkInt(loc, imm, 6, rel); in relocate() 393 checkInt(loc, val, 21, rel); in relocate() 394 checkAlignment(loc, val, 2, rel); in relocate() [all …]
|
H A D | ARM.cpp | 49 void relocate(uint8_t *loc, const Relocation &rel, 537 static void encodeAluGroup(uint8_t *loc, const Relocation &rel, uint64_t val, in encodeAluGroup() argument 556 " for relocation " + toString(rel.type)); in encodeAluGroup() 560 static void encodeLdrGroup(uint8_t *loc, const Relocation &rel, uint64_t val, in encodeLdrGroup() argument 565 if (rel.sym->isFunc()) in encodeLdrGroup() 574 checkUInt(loc, imm, 12, rel); in encodeLdrGroup() 578 static void encodeLdrsGroup(uint8_t *loc, const Relocation &rel, uint64_t val, in encodeLdrsGroup() argument 583 if (rel.sym->isFunc()) in encodeLdrsGroup() 592 checkUInt(loc, imm, 8, rel); in encodeLdrsGroup() 597 void ARM::relocate(uint8_t *loc, const Relocation &rel, uint64_t val) const { in relocate() argument [all …]
|
/freebsd/contrib/llvm-project/lld/ELF/ |
H A D | Relocations.cpp | 99 void elf::reportRangeError(uint8_t *loc, const Relocation &rel, const Twine &v, in reportRangeError() argument 103 if (rel.sym) { in reportRangeError() 104 if (!rel.sym->isSection()) in reportRangeError() 105 hint = "; references '" + lld::toString(*rel.sym) + '\''; in reportRangeError() 106 else if (auto *d = dyn_cast<Defined>(rel.sym)) in reportRangeError() 109 if (config->emachine == EM_X86_64 && rel.type == R_X86_64_PC32 && in reportRangeError() 110 rel.sym->getOutputSection() && in reportRangeError() 111 (rel.sym->getOutputSection()->flags & SHF_X86_64_LARGE)) { in reportRangeError() 118 if (rel.sym && !rel.sym->isSection()) in reportRangeError() 119 hint += getDefinedLocation(*rel.sym); in reportRangeError() [all …]
|
H A D | MarkLive.cpp | 58 void resolveReloc(InputSectionBase &sec, RelTy &rel, bool fromFDE); 77 const typename ELFT::Rel &rel) { in getAddend() argument 78 return target->getImplicitAddend(sec.content().begin() + rel.r_offset, in getAddend() 79 rel.getType(config->isMips64EL)); in getAddend() 84 const typename ELFT::Rela &rel) { in getAddend() argument 85 return rel.r_addend; in getAddend() 91 const typename ELFT::Crel &rel) { in getAddend() argument 92 return rel.r_addend; in getAddend() 97 void MarkLive<ELFT>::resolveReloc(InputSectionBase &sec, RelTy &rel, in resolveReloc() argument 100 Symbol &sym = sec.file->getRelocTargetSym(rel); in resolveReloc() [all …]
|
H A D | Target.cpp | 167 for (const Relocation &rel : sec.relocs()) { in relocateAlloc() local 168 uint8_t *loc = buf + rel.offset; in relocateAlloc() 170 sec.getRelocTargetVA(sec.file, rel.type, rel.addend, in relocateAlloc() 171 secAddr + rel.offset, *rel.sym, rel.expr), in relocateAlloc() 173 if (rel.expr != R_RELAX_HINT) in relocateAlloc() 174 relocate(loc, rel, val); in relocateAlloc()
|
/freebsd/libexec/rtld-elf/ |
H A D | debug.c | 80 dump_Elf_Rel(obj, obj->rel, obj->relsize); in dump_obj_relocations() 105 const Elf_Rel *rel; in dump_Elf_Rel() local 112 for (rel = rel0; rel < rellim; rel++) { in dump_Elf_Rel() 113 dstaddr = (Elf_Addr *)(obj->relocbase + rel->r_offset); in dump_Elf_Rel() 114 sym = obj->symtab + ELF_R_SYM(rel->r_info); in dump_Elf_Rel() 117 (u_long)rel->r_info, (u_long)rel->r_offset, in dump_Elf_Rel()
|
/freebsd/usr.bin/rpcgen/ |
H A D | rpc_cout.c | 136 def->def.ty.rel)); in print_header() 203 print_ifstat(int indent, const char *prefix, const char *type, relation rel, in print_ifstat() argument 209 switch (rel) { in print_ifstat() 326 if (isvectordef (cs->type, cs->rel)) { in emit_union() 333 print_ifstat(2, cs->prefix, cs->type, cs->rel, in emit_union() 345 if (isvectordef (dflt->type, dflt->rel)) { in emit_union() 353 print_ifstat(2, dflt->prefix, dflt->type, dflt->rel, in emit_union() 394 ((dl->decl.rel == REL_ALIAS) || in inline_struct() 395 (dl->decl.rel == REL_VECTOR))){ in inline_struct() 400 if (dl->decl.rel == REL_ALIAS) in inline_struct() [all …]
|
/freebsd/stand/common/ |
H A D | reloc_elf.c | 59 const Elf_Rel *rel; in __elfN() local 64 rel = (const Elf_Rel *)reldata; in __elfN() 65 where = (Elf_Addr *)((char *)data + relbase + rel->r_offset - in __elfN() 68 rtype = ELF_R_TYPE(rel->r_info); in __elfN() 70 symidx = ELF_R_SYM(rel->r_info); in __elfN() 134 const Elf_Rel *rel; in __elfN() 139 rel = (const Elf_Rel *)reldata; in __elfN() 140 where = (Elf_Addr *)((char *)data + relbase + rel->r_offset - in __elfN() 143 rtype = ELF_R_TYPE(rel->r_info); in __elfN() 144 symidx = ELF_R_SYM(rel->r_info); in __elfN()
|
H A D | self_reloc.c | 70 ElfW_Rel *rel; in self_reloc() local 82 rel = (ElfW_Rel *)(dynp->d_un.d_ptr + baseaddr); in self_reloc() 103 switch (ELFW_R_TYPE(rel->r_info)) { in self_reloc() 109 newaddr = (Elf_Addr *)(rel->r_offset + baseaddr); in self_reloc() 112 *newaddr = baseaddr + rel->r_addend; in self_reloc() 122 rel = (ElfW_Rel *)(void *)((caddr_t) rel + relent); in self_reloc()
|
/freebsd/contrib/llvm-project/lld/COFF/ |
H A D | Chunks.cpp | 359 const coff_relocation &rel, in maybeReportRelocationToDiscarded() argument 376 check(file->getCOFFObj()->getSymbol(rel.SymbolTableIndex)); in maybeReportRelocationToDiscarded() 381 getSymbolLocations(file, rel.SymbolTableIndex); in maybeReportRelocationToDiscarded() 401 for (const coff_relocation &rel : getRelocs()) { in writeTo() local 406 if (rel.VirtualAddress >= inputSize) { in writeTo() 411 applyRelocation(buf + rel.VirtualAddress, rel); in writeTo() 422 const coff_relocation &rel) const { in applyRelocation() 423 auto *sym = dyn_cast_or_null<Defined>(file->getSymbol(rel.SymbolTableIndex)); in applyRelocation() 437 maybeReportRelocationToDiscarded(this, sym, rel, file->ctx.config.mingw); in applyRelocation() 444 uint64_t p = rva + rel.VirtualAddress; in applyRelocation() [all …]
|