History

x86-64 bug fix: Fix stab generation for x86-64.

The size of a stab entry is 12 bytes even in 64bit environments. We must use int instead of long to keep the size of stab entries.

Shinichiro Hamaji committed 17 years ago

Commit 754b0be1 parent e6db5f51 file · +3 −3Browse files

Unified · Split

tccelf.c+3−3
@@ -295,11 +295,11 @@ static void put_elf_reloc(Section *symtab, Section *s, unsigned long offset, · 294 unmodified lines
295295 /* put stab debug information */
296296
297297 typedef struct {
298− unsigned long n_strx; /* index into string table of name */
298+ unsigned int n_strx; /* index into string table of name */
299299 unsigned char n_type; /* type of symbol */
300300 unsigned char n_other; /* misc info (usually empty) */
301301 unsigned short n_desc; /* description field */
302− unsigned long n_value; /* value of symbol */
302+ unsigned int n_value; /* value of symbol */
303303 } Stab_Sym;
304304
305305 static void put_stabs(const char *str, int type, int other, int desc,
@@ -324,7 +324,7 @@ static void put_stabs_r(const char *str, int type, int other, int desc, · 18 unmodified lines
324324 {
325325 put_stabs(str, type, other, desc, value);
326326 put_elf_reloc(symtab_section, stab_section,
327− stab_section->data_offset - sizeof(unsigned long),
327+ stab_section->data_offset - sizeof(unsigned int),
328328 R_DATA_32, sym_index);
329329 }
330330