#include <stdlib.h>
#include <string.h>
#include "myio.h"
#include "elfflt.h"
gehe zum Quellcode dieser Datei
Definiert in Zeile 214 der Datei elf-arm.c.
222 char* loc = (
char*)(
flat_buf + locoffset );
227 if (ret > 0) { symname=symbuf; symbuf[
sizeof(symbuf)-1]=0; }
236 printf(
"R_ARM_ABS32: %p(%s+0x%x=%x): import_value=%d (sym:%s)+0x%x %d\n",
247 PRINTERR(stderr,
"Only R_ARM_ABS32 relocations could be processed as imported symbol (%s). Please compile with -mlong-call or use manual import\n",symname);
Definiert in Zeile 18 der Datei elf-arm.c.
27 char* loc = (
char*)(
flat_buf + locoffset );
30 int relindex = tgt_sect->
number;
35 if (ret > 0) { symname=symbuf; symbuf[
sizeof(symbuf)-1]=0; }
44 PRINTERR(stderr,
"section %u(%s) reloc %u sym '%s': out of bounds relocation, offset %d size %u\n",
45 relindex, base_sect->
name, i, symname,
57 printf(
"R_ARM_ABS32: %p(%s+0x%x=%x): ptr=%x [%s+0x%x+0x%x] sym:%s\n",
89 sign = (upper >> 10) & 1;
90 j1 = (lower >> 13) & 1;
91 j2 = (lower >> 11) & 1;
92 offset = (sign << 24) | ((~(j1 ^ sign) & 1) << 23) |
93 ((~(j2 ^ sign) & 1) << 22) |
94 ((upper & 0x03ff) << 12) |
95 ((lower & 0x07ff) << 1);
96 if (offset & 0x01000000)
98 offset += tgt_fulloffset - locoffset;
111 offset <= (
int32_t)0xff000000 ||
112 offset >= (
int32_t)0x01000000) {
113 PRINTERR(stderr,
"section %u reloc %u sym '%s': relocation %u out of range (%#lx -> %#x)\n",
114 relindex, i, symname,
121 printf(
"R_ARM_THM_CALL: %p(%s+0x%x=%x): %04x %04x ptr=%x [loc%-d] sym:%s\n",
127 sign = (offset >> 24) & 1;
128 j1 = sign ^ (~(offset >> 23) & 1);
129 j2 = sign ^ (~(offset >> 22) & 1);
131 ((offset >> 12) & 0x03ff));
133 (j1 << 13) | (j2 << 11) |
134 ((offset >> 1) & 0x07ff));
144 if (
strcmp(symname,
"__div0") == 0 )
147 patch_name=
".divsi3_skip_div0_test";
149 patch_name=
"__aeabi_uidiv";
152 PRINTERR( stderr,
"%s is requested from unusual place .text+0x%x\n", reloc_name,locoffset-
text.flat_offset);
167 reloc_name = (type==
R_ARM_PC24)?
"R_ARM_PC24":
"R_ARM_PLT32";
169 offset = (*(
uint32_t *)loc & 0x00ffffff) << 2;
170 if (offset & 0x02000000)
171 offset -= 0x04000000;
173 offset += tgt_fulloffset - locoffset;
191 printf(
"%s: %p(%s+0x%x=%x): %08x ptr=%x [loc%-d] sym:%s\n", reloc_name,
201 *(
uint32_t *)loc |= offset & 0x00ffffff;
204 PRINTERR(stderr,
"Unknown relocation type %d\n",type);