Commit 4a1a170759e7036dd597e1db3bd2a7688760d6d3
1 parent
bb433bef
Reduce variable shadowing, by Stefan Weil.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3065 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
66 additions
and
66 deletions
dyngen.c
... | ... | @@ -1845,7 +1845,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
1845 | 1845 | /* patch relocations */ |
1846 | 1846 | #if defined(HOST_I386) |
1847 | 1847 | { |
1848 | - char name[256]; | |
1848 | + char relname[256]; | |
1849 | 1849 | int type; |
1850 | 1850 | int addend; |
1851 | 1851 | int reloc_offset; |
... | ... | @@ -1868,18 +1868,18 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
1868 | 1868 | continue; |
1869 | 1869 | } |
1870 | 1870 | |
1871 | - get_reloc_expr(name, sizeof(name), sym_name); | |
1871 | + get_reloc_expr(relname, sizeof(relname), sym_name); | |
1872 | 1872 | addend = get32((uint32_t *)(text + rel->r_offset)); |
1873 | 1873 | #ifdef CONFIG_FORMAT_ELF |
1874 | 1874 | type = ELF32_R_TYPE(rel->r_info); |
1875 | 1875 | switch(type) { |
1876 | 1876 | case R_386_32: |
1877 | 1877 | fprintf(outfile, " *(uint32_t *)(gen_code_ptr + %d) = %s + %d;\n", |
1878 | - reloc_offset, name, addend); | |
1878 | + reloc_offset, relname, addend); | |
1879 | 1879 | break; |
1880 | 1880 | case R_386_PC32: |
1881 | 1881 | fprintf(outfile, " *(uint32_t *)(gen_code_ptr + %d) = %s - (long)(gen_code_ptr + %d) + %d;\n", |
1882 | - reloc_offset, name, reloc_offset, addend); | |
1882 | + reloc_offset, relname, reloc_offset, addend); | |
1883 | 1883 | break; |
1884 | 1884 | default: |
1885 | 1885 | error("unsupported i386 relocation (%d)", type); |
... | ... | @@ -1902,11 +1902,11 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
1902 | 1902 | switch(type) { |
1903 | 1903 | case DIR32: |
1904 | 1904 | fprintf(outfile, " *(uint32_t *)(gen_code_ptr + %d) = %s + %d;\n", |
1905 | - reloc_offset, name, addend); | |
1905 | + reloc_offset, relname, addend); | |
1906 | 1906 | break; |
1907 | 1907 | case DISP32: |
1908 | 1908 | fprintf(outfile, " *(uint32_t *)(gen_code_ptr + %d) = %s - (long)(gen_code_ptr + %d) + %d -4;\n", |
1909 | - reloc_offset, name, reloc_offset, addend); | |
1909 | + reloc_offset, relname, reloc_offset, addend); | |
1910 | 1910 | break; |
1911 | 1911 | default: |
1912 | 1912 | error("unsupported i386 relocation (%d)", type); |
... | ... | @@ -1919,7 +1919,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
1919 | 1919 | } |
1920 | 1920 | #elif defined(HOST_X86_64) |
1921 | 1921 | { |
1922 | - char name[256]; | |
1922 | + char relname[256]; | |
1923 | 1923 | int type; |
1924 | 1924 | int addend; |
1925 | 1925 | int reloc_offset; |
... | ... | @@ -1927,22 +1927,22 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
1927 | 1927 | if (rel->r_offset >= start_offset && |
1928 | 1928 | rel->r_offset < start_offset + copy_size) { |
1929 | 1929 | sym_name = strtab + symtab[ELFW(R_SYM)(rel->r_info)].st_name; |
1930 | - get_reloc_expr(name, sizeof(name), sym_name); | |
1930 | + get_reloc_expr(relname, sizeof(relname), sym_name); | |
1931 | 1931 | type = ELF32_R_TYPE(rel->r_info); |
1932 | 1932 | addend = rel->r_addend; |
1933 | 1933 | reloc_offset = rel->r_offset - start_offset; |
1934 | 1934 | switch(type) { |
1935 | 1935 | case R_X86_64_32: |
1936 | 1936 | fprintf(outfile, " *(uint32_t *)(gen_code_ptr + %d) = (uint32_t)%s + %d;\n", |
1937 | - reloc_offset, name, addend); | |
1937 | + reloc_offset, relname, addend); | |
1938 | 1938 | break; |
1939 | 1939 | case R_X86_64_32S: |
1940 | 1940 | fprintf(outfile, " *(uint32_t *)(gen_code_ptr + %d) = (int32_t)%s + %d;\n", |
1941 | - reloc_offset, name, addend); | |
1941 | + reloc_offset, relname, addend); | |
1942 | 1942 | break; |
1943 | 1943 | case R_X86_64_PC32: |
1944 | 1944 | fprintf(outfile, " *(uint32_t *)(gen_code_ptr + %d) = %s - (long)(gen_code_ptr + %d) + %d;\n", |
1945 | - reloc_offset, name, reloc_offset, addend); | |
1945 | + reloc_offset, relname, reloc_offset, addend); | |
1946 | 1946 | break; |
1947 | 1947 | default: |
1948 | 1948 | error("unsupported X86_64 relocation (%d)", type); |
... | ... | @@ -1953,7 +1953,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
1953 | 1953 | #elif defined(HOST_PPC) |
1954 | 1954 | { |
1955 | 1955 | #ifdef CONFIG_FORMAT_ELF |
1956 | - char name[256]; | |
1956 | + char relname[256]; | |
1957 | 1957 | int type; |
1958 | 1958 | int addend; |
1959 | 1959 | int reloc_offset; |
... | ... | @@ -1974,30 +1974,30 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
1974 | 1974 | continue; |
1975 | 1975 | } |
1976 | 1976 | |
1977 | - get_reloc_expr(name, sizeof(name), sym_name); | |
1977 | + get_reloc_expr(relname, sizeof(relname), sym_name); | |
1978 | 1978 | type = ELF32_R_TYPE(rel->r_info); |
1979 | 1979 | addend = rel->r_addend; |
1980 | 1980 | switch(type) { |
1981 | 1981 | case R_PPC_ADDR32: |
1982 | 1982 | fprintf(outfile, " *(uint32_t *)(gen_code_ptr + %d) = %s + %d;\n", |
1983 | - reloc_offset, name, addend); | |
1983 | + reloc_offset, relname, addend); | |
1984 | 1984 | break; |
1985 | 1985 | case R_PPC_ADDR16_LO: |
1986 | 1986 | fprintf(outfile, " *(uint16_t *)(gen_code_ptr + %d) = (%s + %d);\n", |
1987 | - reloc_offset, name, addend); | |
1987 | + reloc_offset, relname, addend); | |
1988 | 1988 | break; |
1989 | 1989 | case R_PPC_ADDR16_HI: |
1990 | 1990 | fprintf(outfile, " *(uint16_t *)(gen_code_ptr + %d) = (%s + %d) >> 16;\n", |
1991 | - reloc_offset, name, addend); | |
1991 | + reloc_offset, relname, addend); | |
1992 | 1992 | break; |
1993 | 1993 | case R_PPC_ADDR16_HA: |
1994 | 1994 | fprintf(outfile, " *(uint16_t *)(gen_code_ptr + %d) = (%s + %d + 0x8000) >> 16;\n", |
1995 | - reloc_offset, name, addend); | |
1995 | + reloc_offset, relname, addend); | |
1996 | 1996 | break; |
1997 | 1997 | case R_PPC_REL24: |
1998 | 1998 | /* warning: must be at 32 MB distancy */ |
1999 | 1999 | fprintf(outfile, " *(uint32_t *)(gen_code_ptr + %d) = (*(uint32_t *)(gen_code_ptr + %d) & ~0x03fffffc) | ((%s - (long)(gen_code_ptr + %d) + %d) & 0x03fffffc);\n", |
2000 | - reloc_offset, reloc_offset, name, reloc_offset, addend); | |
2000 | + reloc_offset, reloc_offset, relname, reloc_offset, addend); | |
2001 | 2001 | break; |
2002 | 2002 | default: |
2003 | 2003 | error("unsupported powerpc relocation (%d)", type); |
... | ... | @@ -2055,7 +2055,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2055 | 2055 | if(!sym_name) |
2056 | 2056 | { |
2057 | 2057 | fprintf(outfile, "/* #warning relocation not handled in %s (value 0x%x, %s, offset 0x%x, length 0x%x, %s, type 0x%x) */\n", |
2058 | - name, value, usesym ? "use sym" : "don't use sym", offset, length, pcrel ? "pcrel":"", type); | |
2058 | + relname, value, usesym ? "use sym" : "don't use sym", offset, length, pcrel ? "pcrel":"", type); | |
2059 | 2059 | continue; /* dunno how to handle without final_sym_name */ |
2060 | 2060 | } |
2061 | 2061 | |
... | ... | @@ -2067,7 +2067,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2067 | 2067 | fprintf(outfile, "{\n"); |
2068 | 2068 | fprintf(outfile, " uint32_t imm = *(uint32_t *)(gen_code_ptr + %d) & 0x3fffffc;\n", slide); |
2069 | 2069 | fprintf(outfile, " *(uint32_t *)(gen_code_ptr + %d) = (*(uint32_t *)(gen_code_ptr + %d) & ~0x03fffffc) | ((imm + ((long)%s - (long)gen_code_ptr) + %d) & 0x03fffffc);\n", |
2070 | - slide, slide, name, sslide ); | |
2070 | + slide, slide, relname, sslide ); | |
2071 | 2071 | fprintf(outfile, "}\n"); |
2072 | 2072 | } else { |
2073 | 2073 | fprintf(outfile, " *(uint32_t *)(gen_code_ptr + %d) = (*(uint32_t *)(gen_code_ptr + %d) & ~0x03fffffc) | (((long)%s - (long)gen_code_ptr - %d) & 0x03fffffc);\n", |
... | ... | @@ -2096,7 +2096,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2096 | 2096 | } |
2097 | 2097 | #elif defined(HOST_S390) |
2098 | 2098 | { |
2099 | - char name[256]; | |
2099 | + char relname[256]; | |
2100 | 2100 | int type; |
2101 | 2101 | int addend; |
2102 | 2102 | int reloc_offset; |
... | ... | @@ -2104,22 +2104,22 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2104 | 2104 | if (rel->r_offset >= start_offset && |
2105 | 2105 | rel->r_offset < start_offset + copy_size) { |
2106 | 2106 | sym_name = strtab + symtab[ELFW(R_SYM)(rel->r_info)].st_name; |
2107 | - get_reloc_expr(name, sizeof(name), sym_name); | |
2107 | + get_reloc_expr(relname, sizeof(relname), sym_name); | |
2108 | 2108 | type = ELF32_R_TYPE(rel->r_info); |
2109 | 2109 | addend = rel->r_addend; |
2110 | 2110 | reloc_offset = rel->r_offset - start_offset; |
2111 | 2111 | switch(type) { |
2112 | 2112 | case R_390_32: |
2113 | 2113 | fprintf(outfile, " *(uint32_t *)(gen_code_ptr + %d) = %s + %d;\n", |
2114 | - reloc_offset, name, addend); | |
2114 | + reloc_offset, relname, addend); | |
2115 | 2115 | break; |
2116 | 2116 | case R_390_16: |
2117 | 2117 | fprintf(outfile, " *(uint16_t *)(gen_code_ptr + %d) = %s + %d;\n", |
2118 | - reloc_offset, name, addend); | |
2118 | + reloc_offset, relname, addend); | |
2119 | 2119 | break; |
2120 | 2120 | case R_390_8: |
2121 | 2121 | fprintf(outfile, " *(uint8_t *)(gen_code_ptr + %d) = %s + %d;\n", |
2122 | - reloc_offset, name, addend); | |
2122 | + reloc_offset, relname, addend); | |
2123 | 2123 | break; |
2124 | 2124 | default: |
2125 | 2125 | error("unsupported s390 relocation (%d)", type); |
... | ... | @@ -2187,7 +2187,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2187 | 2187 | { |
2188 | 2188 | unsigned long sym_idx; |
2189 | 2189 | long code_offset; |
2190 | - char name[256]; | |
2190 | + char relname[256]; | |
2191 | 2191 | int type; |
2192 | 2192 | long addend; |
2193 | 2193 | |
... | ... | @@ -2210,7 +2210,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2210 | 2210 | n, code_offset); |
2211 | 2211 | continue; |
2212 | 2212 | } |
2213 | - get_reloc_expr(name, sizeof(name), sym_name); | |
2213 | + get_reloc_expr(relname, sizeof(relname), sym_name); | |
2214 | 2214 | type = ELF64_R_TYPE(rel->r_info); |
2215 | 2215 | addend = rel->r_addend; |
2216 | 2216 | switch(type) { |
... | ... | @@ -2218,19 +2218,19 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2218 | 2218 | fprintf(outfile, |
2219 | 2219 | " ia64_imm64(gen_code_ptr + %ld, " |
2220 | 2220 | "%s + %ld);\n", |
2221 | - code_offset, name, addend); | |
2221 | + code_offset, relname, addend); | |
2222 | 2222 | break; |
2223 | 2223 | case R_IA64_LTOFF22X: |
2224 | 2224 | case R_IA64_LTOFF22: |
2225 | 2225 | fprintf(outfile, " IA64_LTOFF(gen_code_ptr + %ld," |
2226 | 2226 | " %s + %ld, %d);\n", |
2227 | - code_offset, name, addend, | |
2227 | + code_offset, relname, addend, | |
2228 | 2228 | (type == R_IA64_LTOFF22X)); |
2229 | 2229 | break; |
2230 | 2230 | case R_IA64_LDXMOV: |
2231 | 2231 | fprintf(outfile, |
2232 | 2232 | " ia64_ldxmov(gen_code_ptr + %ld," |
2233 | - " %s + %ld);\n", code_offset, name, addend); | |
2233 | + " %s + %ld);\n", code_offset, relname, addend); | |
2234 | 2234 | break; |
2235 | 2235 | |
2236 | 2236 | case R_IA64_PCREL21B: |
... | ... | @@ -2239,7 +2239,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2239 | 2239 | " ia64_imm21b(gen_code_ptr + %ld," |
2240 | 2240 | " (long) (%s + %ld -\n\t\t" |
2241 | 2241 | "((long) gen_code_ptr + %ld)) >> 4);\n", |
2242 | - code_offset, name, addend, | |
2242 | + code_offset, relname, addend, | |
2243 | 2243 | code_offset & ~0xfUL); |
2244 | 2244 | } else { |
2245 | 2245 | fprintf(outfile, |
... | ... | @@ -2260,7 +2260,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2260 | 2260 | } |
2261 | 2261 | #elif defined(HOST_SPARC) |
2262 | 2262 | { |
2263 | - char name[256]; | |
2263 | + char relname[256]; | |
2264 | 2264 | int type; |
2265 | 2265 | int addend; |
2266 | 2266 | int reloc_offset; |
... | ... | @@ -2268,14 +2268,14 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2268 | 2268 | if (rel->r_offset >= start_offset && |
2269 | 2269 | rel->r_offset < start_offset + copy_size) { |
2270 | 2270 | sym_name = strtab + symtab[ELF32_R_SYM(rel->r_info)].st_name; |
2271 | - get_reloc_expr(name, sizeof(name), sym_name); | |
2271 | + get_reloc_expr(relname, sizeof(relname), sym_name); | |
2272 | 2272 | type = ELF32_R_TYPE(rel->r_info); |
2273 | 2273 | addend = rel->r_addend; |
2274 | 2274 | reloc_offset = rel->r_offset - start_offset; |
2275 | 2275 | switch(type) { |
2276 | 2276 | case R_SPARC_32: |
2277 | 2277 | fprintf(outfile, " *(uint32_t *)(gen_code_ptr + %d) = %s + %d;\n", |
2278 | - reloc_offset, name, addend); | |
2278 | + reloc_offset, relname, addend); | |
2279 | 2279 | break; |
2280 | 2280 | case R_SPARC_HI22: |
2281 | 2281 | fprintf(outfile, |
... | ... | @@ -2283,7 +2283,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2283 | 2283 | "((*(uint32_t *)(gen_code_ptr + %d)) " |
2284 | 2284 | " & ~0x3fffff) " |
2285 | 2285 | " | (((%s + %d) >> 10) & 0x3fffff);\n", |
2286 | - reloc_offset, reloc_offset, name, addend); | |
2286 | + reloc_offset, reloc_offset, relname, addend); | |
2287 | 2287 | break; |
2288 | 2288 | case R_SPARC_LO10: |
2289 | 2289 | fprintf(outfile, |
... | ... | @@ -2291,7 +2291,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2291 | 2291 | "((*(uint32_t *)(gen_code_ptr + %d)) " |
2292 | 2292 | " & ~0x3ff) " |
2293 | 2293 | " | ((%s + %d) & 0x3ff);\n", |
2294 | - reloc_offset, reloc_offset, name, addend); | |
2294 | + reloc_offset, reloc_offset, relname, addend); | |
2295 | 2295 | break; |
2296 | 2296 | case R_SPARC_WDISP30: |
2297 | 2297 | fprintf(outfile, |
... | ... | @@ -2300,7 +2300,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2300 | 2300 | " & ~0x3fffffff) " |
2301 | 2301 | " | ((((%s + %d) - (long)(gen_code_ptr + %d))>>2) " |
2302 | 2302 | " & 0x3fffffff);\n", |
2303 | - reloc_offset, reloc_offset, name, addend, | |
2303 | + reloc_offset, reloc_offset, relname, addend, | |
2304 | 2304 | reloc_offset); |
2305 | 2305 | break; |
2306 | 2306 | case R_SPARC_WDISP22: |
... | ... | @@ -2312,7 +2312,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2312 | 2312 | " & 0x3fffff);\n", |
2313 | 2313 | rel->r_offset - start_offset, |
2314 | 2314 | rel->r_offset - start_offset, |
2315 | - name, addend, | |
2315 | + relname, addend, | |
2316 | 2316 | rel->r_offset - start_offset); |
2317 | 2317 | break; |
2318 | 2318 | default: |
... | ... | @@ -2323,7 +2323,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2323 | 2323 | } |
2324 | 2324 | #elif defined(HOST_SPARC64) |
2325 | 2325 | { |
2326 | - char name[256]; | |
2326 | + char relname[256]; | |
2327 | 2327 | int type; |
2328 | 2328 | int addend; |
2329 | 2329 | int reloc_offset; |
... | ... | @@ -2331,14 +2331,14 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2331 | 2331 | if (rel->r_offset >= start_offset && |
2332 | 2332 | rel->r_offset < start_offset + copy_size) { |
2333 | 2333 | sym_name = strtab + symtab[ELF64_R_SYM(rel->r_info)].st_name; |
2334 | - get_reloc_expr(name, sizeof(name), sym_name); | |
2334 | + get_reloc_expr(relname, sizeof(relname), sym_name); | |
2335 | 2335 | type = ELF32_R_TYPE(rel->r_info); |
2336 | 2336 | addend = rel->r_addend; |
2337 | 2337 | reloc_offset = rel->r_offset - start_offset; |
2338 | 2338 | switch(type) { |
2339 | 2339 | case R_SPARC_32: |
2340 | 2340 | fprintf(outfile, " *(uint32_t *)(gen_code_ptr + %d) = %s + %d;\n", |
2341 | - reloc_offset, name, addend); | |
2341 | + reloc_offset, relname, addend); | |
2342 | 2342 | break; |
2343 | 2343 | case R_SPARC_HI22: |
2344 | 2344 | fprintf(outfile, |
... | ... | @@ -2346,7 +2346,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2346 | 2346 | "((*(uint32_t *)(gen_code_ptr + %d)) " |
2347 | 2347 | " & ~0x3fffff) " |
2348 | 2348 | " | (((%s + %d) >> 10) & 0x3fffff);\n", |
2349 | - reloc_offset, reloc_offset, name, addend); | |
2349 | + reloc_offset, reloc_offset, relname, addend); | |
2350 | 2350 | break; |
2351 | 2351 | case R_SPARC_LO10: |
2352 | 2352 | fprintf(outfile, |
... | ... | @@ -2354,7 +2354,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2354 | 2354 | "((*(uint32_t *)(gen_code_ptr + %d)) " |
2355 | 2355 | " & ~0x3ff) " |
2356 | 2356 | " | ((%s + %d) & 0x3ff);\n", |
2357 | - reloc_offset, reloc_offset, name, addend); | |
2357 | + reloc_offset, reloc_offset, relname, addend); | |
2358 | 2358 | break; |
2359 | 2359 | case R_SPARC_OLO10: |
2360 | 2360 | addend += ELF64_R_TYPE_DATA (rel->r_info); |
... | ... | @@ -2363,7 +2363,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2363 | 2363 | "((*(uint32_t *)(gen_code_ptr + %d)) " |
2364 | 2364 | " & ~0x3ff) " |
2365 | 2365 | " | ((%s + %d) & 0x3ff);\n", |
2366 | - reloc_offset, reloc_offset, name, addend); | |
2366 | + reloc_offset, reloc_offset, relname, addend); | |
2367 | 2367 | break; |
2368 | 2368 | case R_SPARC_WDISP30: |
2369 | 2369 | fprintf(outfile, |
... | ... | @@ -2372,7 +2372,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2372 | 2372 | " & ~0x3fffffff) " |
2373 | 2373 | " | ((((%s + %d) - (long)(gen_code_ptr + %d))>>2) " |
2374 | 2374 | " & 0x3fffffff);\n", |
2375 | - reloc_offset, reloc_offset, name, addend, | |
2375 | + reloc_offset, reloc_offset, relname, addend, | |
2376 | 2376 | reloc_offset); |
2377 | 2377 | break; |
2378 | 2378 | case R_SPARC_WDISP22: |
... | ... | @@ -2382,7 +2382,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2382 | 2382 | " & ~0x3fffff) " |
2383 | 2383 | " | ((((%s + %d) - (long)(gen_code_ptr + %d))>>2) " |
2384 | 2384 | " & 0x3fffff);\n", |
2385 | - reloc_offset, reloc_offset, name, addend, | |
2385 | + reloc_offset, reloc_offset, relname, addend, | |
2386 | 2386 | reloc_offset); |
2387 | 2387 | break; |
2388 | 2388 | case R_SPARC_HH22: |
... | ... | @@ -2391,7 +2391,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2391 | 2391 | "((*(uint32_t *)(gen_code_ptr + %d)) " |
2392 | 2392 | " & ~0x00000000) " |
2393 | 2393 | " | (((%s + %d) >> 42) & 0x00000000);\n", |
2394 | - reloc_offset, reloc_offset, name, addend); | |
2394 | + reloc_offset, reloc_offset, relname, addend); | |
2395 | 2395 | break; |
2396 | 2396 | |
2397 | 2397 | case R_SPARC_LM22: |
... | ... | @@ -2400,7 +2400,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2400 | 2400 | "((*(uint32_t *)(gen_code_ptr + %d)) " |
2401 | 2401 | " & ~0x00000000) " |
2402 | 2402 | " | (((%s + %d) >> 10) & 0x00000000);\n", |
2403 | - reloc_offset, reloc_offset, name, addend); | |
2403 | + reloc_offset, reloc_offset, relname, addend); | |
2404 | 2404 | break; |
2405 | 2405 | |
2406 | 2406 | case R_SPARC_HM10: |
... | ... | @@ -2409,18 +2409,18 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2409 | 2409 | "((*(uint32_t *)(gen_code_ptr + %d)) " |
2410 | 2410 | " & ~0x00000000) " |
2411 | 2411 | " | ((((%s + %d) >> 32 & 0x3ff)) & 0x00000000);\n", |
2412 | - reloc_offset, reloc_offset, name, addend); | |
2412 | + reloc_offset, reloc_offset, relname, addend); | |
2413 | 2413 | break; |
2414 | 2414 | |
2415 | 2415 | default: |
2416 | - error("unsupported sparc64 relocation (%d) for symbol %s", type, name); | |
2416 | + error("unsupported sparc64 relocation (%d) for symbol %s", type, relname); | |
2417 | 2417 | } |
2418 | 2418 | } |
2419 | 2419 | } |
2420 | 2420 | } |
2421 | 2421 | #elif defined(HOST_ARM) |
2422 | 2422 | { |
2423 | - char name[256]; | |
2423 | + char relname[256]; | |
2424 | 2424 | int type; |
2425 | 2425 | int addend; |
2426 | 2426 | int reloc_offset; |
... | ... | @@ -2455,7 +2455,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2455 | 2455 | fprintf(outfile, |
2456 | 2456 | " *(uint32_t *)gen_code_ptr = 0x%x;\n", opcode); |
2457 | 2457 | } |
2458 | - arm_emit_ldr_info(name, start_offset, outfile, p_start, p_end, | |
2458 | + arm_emit_ldr_info(relname, start_offset, outfile, p_start, p_end, | |
2459 | 2459 | relocs, nb_relocs); |
2460 | 2460 | |
2461 | 2461 | for(i = 0, rel = relocs;i < nb_relocs; i++, rel++) { |
... | ... | @@ -2465,20 +2465,20 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2465 | 2465 | /* the compiler leave some unnecessary references to the code */ |
2466 | 2466 | if (sym_name[0] == '\0') |
2467 | 2467 | continue; |
2468 | - get_reloc_expr(name, sizeof(name), sym_name); | |
2468 | + get_reloc_expr(relname, sizeof(relname), sym_name); | |
2469 | 2469 | type = ELF32_R_TYPE(rel->r_info); |
2470 | 2470 | addend = get32((uint32_t *)(text + rel->r_offset)); |
2471 | 2471 | reloc_offset = rel->r_offset - start_offset; |
2472 | 2472 | switch(type) { |
2473 | 2473 | case R_ARM_ABS32: |
2474 | 2474 | fprintf(outfile, " *(uint32_t *)(gen_code_ptr + %d) = %s + %d;\n", |
2475 | - reloc_offset, name, addend); | |
2475 | + reloc_offset, relname, addend); | |
2476 | 2476 | break; |
2477 | 2477 | case R_ARM_PC24: |
2478 | 2478 | case R_ARM_JUMP24: |
2479 | 2479 | case R_ARM_CALL: |
2480 | 2480 | fprintf(outfile, " arm_reloc_pc24((uint32_t *)(gen_code_ptr + %d), 0x%x, %s);\n", |
2481 | - reloc_offset, addend, name); | |
2481 | + reloc_offset, addend, relname); | |
2482 | 2482 | break; |
2483 | 2483 | default: |
2484 | 2484 | error("unsupported arm relocation (%d)", type); |
... | ... | @@ -2488,7 +2488,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2488 | 2488 | } |
2489 | 2489 | #elif defined(HOST_M68K) |
2490 | 2490 | { |
2491 | - char name[256]; | |
2491 | + char relname[256]; | |
2492 | 2492 | int type; |
2493 | 2493 | int addend; |
2494 | 2494 | int reloc_offset; |
... | ... | @@ -2498,7 +2498,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2498 | 2498 | rel->r_offset < start_offset + copy_size) { |
2499 | 2499 | sym = &(symtab[ELFW(R_SYM)(rel->r_info)]); |
2500 | 2500 | sym_name = strtab + symtab[ELFW(R_SYM)(rel->r_info)].st_name; |
2501 | - get_reloc_expr(name, sizeof(name), sym_name); | |
2501 | + get_reloc_expr(relname, sizeof(relname), sym_name); | |
2502 | 2502 | type = ELF32_R_TYPE(rel->r_info); |
2503 | 2503 | addend = get32((uint32_t *)(text + rel->r_offset)) + rel->r_addend; |
2504 | 2504 | reloc_offset = rel->r_offset - start_offset; |
... | ... | @@ -2506,12 +2506,12 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2506 | 2506 | case R_68K_32: |
2507 | 2507 | fprintf(outfile, " /* R_68K_32 RELOC, offset %x */\n", rel->r_offset) ; |
2508 | 2508 | fprintf(outfile, " *(uint32_t *)(gen_code_ptr + %d) = %s + %#x;\n", |
2509 | - reloc_offset, name, addend ); | |
2509 | + reloc_offset, relname, addend ); | |
2510 | 2510 | break; |
2511 | 2511 | case R_68K_PC32: |
2512 | 2512 | fprintf(outfile, " /* R_68K_PC32 RELOC, offset %x */\n", rel->r_offset); |
2513 | 2513 | fprintf(outfile, " *(uint32_t *)(gen_code_ptr + %d) = %s - (long)(gen_code_ptr + %#x) + %#x;\n", |
2514 | - reloc_offset, name, reloc_offset, /*sym->st_value+*/ addend); | |
2514 | + reloc_offset, relname, reloc_offset, /*sym->st_value+*/ addend); | |
2515 | 2515 | break; |
2516 | 2516 | default: |
2517 | 2517 | error("unsupported m68k relocation (%d)", type); |
... | ... | @@ -2523,7 +2523,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2523 | 2523 | { |
2524 | 2524 | for (i = 0, rel = relocs; i < nb_relocs; i++, rel++) { |
2525 | 2525 | if (rel->r_offset >= start_offset && rel->r_offset < start_offset + copy_size) { |
2526 | - char name[256]; | |
2526 | + char relname[256]; | |
2527 | 2527 | int type; |
2528 | 2528 | int addend; |
2529 | 2529 | int reloc_offset; |
... | ... | @@ -2532,7 +2532,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2532 | 2532 | /* the compiler leave some unnecessary references to the code */ |
2533 | 2533 | if (sym_name[0] == '\0') |
2534 | 2534 | continue; |
2535 | - get_reloc_expr(name, sizeof(name), sym_name); | |
2535 | + get_reloc_expr(relname, sizeof(relname), sym_name); | |
2536 | 2536 | type = ELF32_R_TYPE(rel->r_info); |
2537 | 2537 | addend = get32((uint32_t *)(text + rel->r_offset)); |
2538 | 2538 | reloc_offset = rel->r_offset - start_offset; |
... | ... | @@ -2545,7 +2545,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2545 | 2545 | "(0x%x & ~0x3fffff) " |
2546 | 2546 | "| ((0x%x + ((%s - (*(uint32_t *)(gen_code_ptr + 0x%x))) >> 2)) " |
2547 | 2547 | " & 0x3fffff);\n", |
2548 | - reloc_offset, addend, addend, name, reloc_offset); | |
2548 | + reloc_offset, addend, addend, relname, reloc_offset); | |
2549 | 2549 | break; |
2550 | 2550 | case R_MIPS_HI16: |
2551 | 2551 | fprintf(outfile, " /* R_MIPS_HI16 RELOC, offset 0x%x, name %s */\n", |
... | ... | @@ -2555,7 +2555,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2555 | 2555 | "((*(uint32_t *)(gen_code_ptr + 0x%x)) " |
2556 | 2556 | " & ~0xffff) " |
2557 | 2557 | " | (((%s - 0x8000) >> 16) & 0xffff);\n", |
2558 | - reloc_offset, reloc_offset, name); | |
2558 | + reloc_offset, reloc_offset, relname); | |
2559 | 2559 | break; |
2560 | 2560 | case R_MIPS_LO16: |
2561 | 2561 | fprintf(outfile, " /* R_MIPS_LO16 RELOC, offset 0x%x, name %s */\n", |
... | ... | @@ -2565,7 +2565,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2565 | 2565 | "((*(uint32_t *)(gen_code_ptr + 0x%x)) " |
2566 | 2566 | " & ~0xffff) " |
2567 | 2567 | " | (%s & 0xffff);\n", |
2568 | - reloc_offset, reloc_offset, name); | |
2568 | + reloc_offset, reloc_offset, relname); | |
2569 | 2569 | break; |
2570 | 2570 | case R_MIPS_PC16: |
2571 | 2571 | fprintf(outfile, " /* R_MIPS_PC16 RELOC, offset 0x%x, name %s */\n", |
... | ... | @@ -2575,7 +2575,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2575 | 2575 | "(0x%x & ~0xffff) " |
2576 | 2576 | "| ((0x%x + ((%s - (*(uint32_t *)(gen_code_ptr + 0x%x))) >> 2)) " |
2577 | 2577 | " & 0xffff);\n", |
2578 | - reloc_offset, addend, addend, name, reloc_offset); | |
2578 | + reloc_offset, addend, addend, relname, reloc_offset); | |
2579 | 2579 | break; |
2580 | 2580 | case R_MIPS_GOT16: |
2581 | 2581 | case R_MIPS_CALL16: |
... | ... | @@ -2586,7 +2586,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size, |
2586 | 2586 | "((*(uint32_t *)(gen_code_ptr + 0x%x)) " |
2587 | 2587 | " & ~0xffff) " |
2588 | 2588 | " | (((%s - 0x8000) >> 16) & 0xffff);\n", |
2589 | - reloc_offset, reloc_offset, name); | |
2589 | + reloc_offset, reloc_offset, relname); | |
2590 | 2590 | break; |
2591 | 2591 | default: |
2592 | 2592 | error("unsupported MIPS relocation (%d)", type); | ... | ... |