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