Lines Matching defs:rel
109 static unsigned RelocType32(const ELFRelocation &rel);
111 static unsigned RelocType64(const ELFRelocation &rel);
113 static unsigned RelocSymbol32(const ELFRelocation &rel);
115 static unsigned RelocSymbol64(const ELFRelocation &rel);
117 static elf_addr RelocOffset32(const ELFRelocation &rel);
119 static elf_addr RelocOffset64(const ELFRelocation &rel);
121 static elf_sxword RelocAddend32(const ELFRelocation &rel);
123 static elf_sxword RelocAddend64(const ELFRelocation &rel);
160 unsigned ELFRelocation::RelocType32(const ELFRelocation &rel) {
161 if (rel.reloc.is<ELFRel *>())
162 return ELFRel::RelocType32(*rel.reloc.get<ELFRel *>());
164 return ELFRela::RelocType32(*rel.reloc.get<ELFRela *>());
167 unsigned ELFRelocation::RelocType64(const ELFRelocation &rel) {
168 if (rel.reloc.is<ELFRel *>())
169 return ELFRel::RelocType64(*rel.reloc.get<ELFRel *>());
171 return ELFRela::RelocType64(*rel.reloc.get<ELFRela *>());
174 unsigned ELFRelocation::RelocSymbol32(const ELFRelocation &rel) {
175 if (rel.reloc.is<ELFRel *>())
176 return ELFRel::RelocSymbol32(*rel.reloc.get<ELFRel *>());
178 return ELFRela::RelocSymbol32(*rel.reloc.get<ELFRela *>());
181 unsigned ELFRelocation::RelocSymbol64(const ELFRelocation &rel) {
182 if (rel.reloc.is<ELFRel *>())
183 return ELFRel::RelocSymbol64(*rel.reloc.get<ELFRel *>());
185 return ELFRela::RelocSymbol64(*rel.reloc.get<ELFRela *>());
188 elf_addr ELFRelocation::RelocOffset32(const ELFRelocation &rel) {
189 if (rel.reloc.is<ELFRel *>())
190 return rel.reloc.get<ELFRel *>()->r_offset;
192 return rel.reloc.get<ELFRela *>()->r_offset;
195 elf_addr ELFRelocation::RelocOffset64(const ELFRelocation &rel) {
196 if (rel.reloc.is<ELFRel *>())
197 return rel.reloc.get<ELFRel *>()->r_offset;
199 return rel.reloc.get<ELFRela *>()->r_offset;
202 elf_sxword ELFRelocation::RelocAddend32(const ELFRelocation &rel) {
203 if (rel.reloc.is<ELFRel *>())
206 return rel.reloc.get<ELFRela *>()->r_addend;
209 elf_sxword ELFRelocation::RelocAddend64(const ELFRelocation &rel) {
210 if (rel.reloc.is<ELFRel *>())
213 return rel.reloc.get<ELFRela *>()->r_addend;
2578 ELFRelocation rel(rel_type);
2587 typedef unsigned (*reloc_info_fn)(const ELFRelocation &rel);
2602 if (!rel.Parse(rel_data, &offset))
2605 if (reloc_type(rel) != slot_type)
2608 lldb::offset_t symbol_offset = reloc_symbol(rel) * sym_hdr->sh_entsize;
2707 static void ApplyELF64ABS64Relocation(Symtab *symtab, ELFRelocation &rel,
2710 Symbol *symbol = symtab->FindSymbolByID(ELFRelocation::RelocSymbol64(rel));
2719 ELFRelocation::RelocOffset64(rel));
2720 uint64_t val_offset = value + ELFRelocation::RelocAddend64(rel);
2725 static void ApplyELF64ABS32Relocation(Symtab *symtab, ELFRelocation &rel,
2728 Symbol *symbol = symtab->FindSymbolByID(ELFRelocation::RelocSymbol64(rel));
2731 value += ELFRelocation::RelocAddend32(rel);
2746 ELFRelocation::RelocOffset32(rel));
2751 static void ApplyELF32ABS32RelRelocation(Symtab *symtab, ELFRelocation &rel,
2755 Symbol *symbol = symtab->FindSymbolByID(ELFRelocation::RelocSymbol32(rel));
2769 ELFRelocation::RelocOffset32(rel);
2794 ELFRelocation rel(rel_hdr->sh_type);
2797 typedef unsigned (*reloc_info_fn)(const ELFRelocation &rel);
2810 if (!rel.Parse(rel_data, &offset)) {
2811 GetModule()->ReportError(".rel{0}[{1:d}] failed to parse relocation",
2820 switch (reloc_type(rel)) {
2822 ApplyELF32ABS32RelRelocation(symtab, rel, debug_data, rel_section);
2826 " .rel{0}[{1}], type {2}",
2828 reloc_type(rel));
2835 switch (reloc_type(rel)) {
2837 symbol = symtab->FindSymbolByID(reloc_symbol(rel));
2840 rel_section->GetFileOffset() + ELFRelocation::RelocOffset32(rel);
2849 if (rel.IsRela()) {
2850 value += ELFRelocation::RelocAddend32(rel);
2856 GetModule()->ReportError(".rel{0}[{1}] unknown symbol id: {2:d}",
2858 reloc_symbol(rel));
2864 " .rel{0}[{1}], type {2}",
2866 reloc_type(rel));
2880 switch (reloc_type(rel)) {
2882 ApplyELF64ABS64Relocation(symtab, rel, debug_data, rel_section);
2885 ApplyELF64ABS32Relocation(symtab, rel, debug_data, rel_section, true);
2892 switch (reloc_type(rel)) {
2894 ApplyELF64ABS64Relocation(symtab, rel, debug_data, rel_section);
2897 ApplyELF64ABS32Relocation(symtab, rel, debug_data, rel_section, true);
2904 switch (reloc_type(rel)) {
2906 ApplyELF64ABS64Relocation(symtab, rel, debug_data, rel_section);
2909 ApplyELF64ABS32Relocation(symtab, rel, debug_data, rel_section,
2913 ApplyELF64ABS32Relocation(symtab, rel, debug_data, rel_section, true);
2951 Section *rel = section_list->FindSectionByID(rel_id).get();
2952 if (!rel)
2967 if (GetData(rel->GetFileOffset(), rel->GetFileSize(), rel_data) &&
3133 std::string needle = std::string(".rel") + section_name;