mirror of
https://github.com/mirror/tinycc.git
synced 2024-12-26 03:50:07 +08:00
Spelling fixes in C comments only
This commit is contained in:
parent
1b9935cf36
commit
19d8b8a173
@ -813,7 +813,7 @@ struct avail_regs {
|
|||||||
and the parameter is a single float.
|
and the parameter is a single float.
|
||||||
|
|
||||||
avregs: opaque structure to keep track of available VFP co-processor regs
|
avregs: opaque structure to keep track of available VFP co-processor regs
|
||||||
align: alignment contraints for the param, as returned by type_size()
|
align: alignment constraints for the param, as returned by type_size()
|
||||||
size: size of the parameter, as returned by type_size() */
|
size: size of the parameter, as returned by type_size() */
|
||||||
int assign_vfpreg(struct avail_regs *avregs, int align, int size)
|
int assign_vfpreg(struct avail_regs *avregs, int align, int size)
|
||||||
{
|
{
|
||||||
@ -823,7 +823,7 @@ int assign_vfpreg(struct avail_regs *avregs, int align, int size)
|
|||||||
return -1;
|
return -1;
|
||||||
if (align >> 3) { /* double alignment */
|
if (align >> 3) { /* double alignment */
|
||||||
first_reg = avregs->first_free_reg;
|
first_reg = avregs->first_free_reg;
|
||||||
/* alignment contraint not respected so use next reg and record hole */
|
/* alignment constraint not respected so use next reg and record hole */
|
||||||
if (first_reg & 1)
|
if (first_reg & 1)
|
||||||
avregs->avail[avregs->last_hole++] = first_reg++;
|
avregs->avail[avregs->last_hole++] = first_reg++;
|
||||||
} else { /* no special alignment (float or array of float) */
|
} else { /* no special alignment (float or array of float) */
|
||||||
@ -1653,7 +1653,7 @@ static int is_zero(int i)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* generate a floating point operation 'v = t1 op t2' instruction. The
|
/* generate a floating point operation 'v = t1 op t2' instruction. The
|
||||||
* two operands are guaranted to have the same floating point type */
|
* two operands are guaranteed to have the same floating point type */
|
||||||
void gen_opf(int op)
|
void gen_opf(int op)
|
||||||
{
|
{
|
||||||
uint32_t x;
|
uint32_t x;
|
||||||
|
@ -62,7 +62,7 @@ int code_reloc (int reloc_type)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns an enumerator to describe wether and when the relocation needs a
|
/* Returns an enumerator to describe whether and when the relocation needs a
|
||||||
GOT and/or PLT entry to be created. See tcc.h for a description of the
|
GOT and/or PLT entry to be created. See tcc.h for a description of the
|
||||||
different values. */
|
different values. */
|
||||||
int gotplt_entry_type (int reloc_type)
|
int gotplt_entry_type (int reloc_type)
|
||||||
@ -109,7 +109,7 @@ ST_FUNC unsigned create_plt_entry(TCCState *s1, unsigned got_offset, struct sym_
|
|||||||
unsigned plt_offset;
|
unsigned plt_offset;
|
||||||
|
|
||||||
/* when building a DLL, GOT entry accesses must be done relative to
|
/* when building a DLL, GOT entry accesses must be done relative to
|
||||||
start of GOT (see x86_64 examble above) */
|
start of GOT (see x86_64 example above) */
|
||||||
if (s1->output_type == TCC_OUTPUT_DLL)
|
if (s1->output_type == TCC_OUTPUT_DLL)
|
||||||
tcc_error("DLLs unimplemented!");
|
tcc_error("DLLs unimplemented!");
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ int code_reloc (int reloc_type)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns an enumerator to describe wether and when the relocation needs a
|
/* Returns an enumerator to describe whether and when the relocation needs a
|
||||||
GOT and/or PLT entry to be created. See tcc.h for a description of the
|
GOT and/or PLT entry to be created. See tcc.h for a description of the
|
||||||
different values. */
|
different values. */
|
||||||
int gotplt_entry_type (int reloc_type)
|
int gotplt_entry_type (int reloc_type)
|
||||||
|
@ -2225,7 +2225,7 @@ void gen_opi(int op)
|
|||||||
r = vtop[-1].r;
|
r = vtop[-1].r;
|
||||||
fr = vtop[0].r;
|
fr = vtop[0].r;
|
||||||
vtop--;
|
vtop--;
|
||||||
C67_MPYI(fr, r); // 32 bit bultiply fr,r,fr
|
C67_MPYI(fr, r); // 32 bit multiply fr,r,fr
|
||||||
C67_NOP(8); // NOP 8 for worst case
|
C67_NOP(8); // NOP 8 for worst case
|
||||||
break;
|
break;
|
||||||
case TOK_SHL:
|
case TOK_SHL:
|
||||||
@ -2282,7 +2282,7 @@ void gen_opi(int op)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* generate a floating point operation 'v = t1 op t2' instruction. The
|
/* generate a floating point operation 'v = t1 op t2' instruction. The
|
||||||
two operands are guaranted to have the same floating point type */
|
two operands are guaranteed to have the same floating point type */
|
||||||
/* XXX: need to use ST1 too */
|
/* XXX: need to use ST1 too */
|
||||||
void gen_opf(int op)
|
void gen_opf(int op)
|
||||||
{
|
{
|
||||||
|
@ -44,7 +44,7 @@ int code_reloc (int reloc_type)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns an enumerator to describe wether and when the relocation needs a
|
/* Returns an enumerator to describe whether and when the relocation needs a
|
||||||
GOT and/or PLT entry to be created. See tcc.h for a description of the
|
GOT and/or PLT entry to be created. See tcc.h for a description of the
|
||||||
different values. */
|
different values. */
|
||||||
int gotplt_entry_type (int reloc_type)
|
int gotplt_entry_type (int reloc_type)
|
||||||
|
2
coff.h
2
coff.h
@ -22,7 +22,7 @@ struct filehdr {
|
|||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
#define F_RELFLG 0x01 /* relocation info stripped from file */
|
#define F_RELFLG 0x01 /* relocation info stripped from file */
|
||||||
#define F_EXEC 0x02 /* file is executable (no unresolved refs) */
|
#define F_EXEC 0x02 /* file is executable (no unresolved refs) */
|
||||||
#define F_LNNO 0x04 /* line nunbers stripped from file */
|
#define F_LNNO 0x04 /* line numbers stripped from file */
|
||||||
#define F_LSYMS 0x08 /* local symbols stripped from file */
|
#define F_LSYMS 0x08 /* local symbols stripped from file */
|
||||||
#define F_GSP10 0x10 /* 34010 version */
|
#define F_GSP10 0x10 /* 34010 version */
|
||||||
#define F_GSP20 0x20 /* 34020 version */
|
#define F_GSP20 0x20 /* 34020 version */
|
||||||
|
12
elf.h
12
elf.h
@ -221,7 +221,7 @@ typedef struct
|
|||||||
#define EM_68HC12 53 /* Motorola M68HC12 */
|
#define EM_68HC12 53 /* Motorola M68HC12 */
|
||||||
#define EM_MMA 54 /* Fujitsu MMA Multimedia Accelerator*/
|
#define EM_MMA 54 /* Fujitsu MMA Multimedia Accelerator*/
|
||||||
#define EM_PCP 55 /* Siemens PCP */
|
#define EM_PCP 55 /* Siemens PCP */
|
||||||
#define EM_NCPU 56 /* Sony nCPU embeeded RISC */
|
#define EM_NCPU 56 /* Sony nCPU embedded RISC */
|
||||||
#define EM_NDR1 57 /* Denso NDR1 microprocessor */
|
#define EM_NDR1 57 /* Denso NDR1 microprocessor */
|
||||||
#define EM_STARCORE 58 /* Motorola Start*Core processor */
|
#define EM_STARCORE 58 /* Motorola Start*Core processor */
|
||||||
#define EM_ME16 59 /* Toyota ME16 processor */
|
#define EM_ME16 59 /* Toyota ME16 processor */
|
||||||
@ -342,7 +342,7 @@ typedef struct
|
|||||||
#define SHT_FINI_ARRAY 15 /* Array of destructors */
|
#define SHT_FINI_ARRAY 15 /* Array of destructors */
|
||||||
#define SHT_PREINIT_ARRAY 16 /* Array of pre-constructors */
|
#define SHT_PREINIT_ARRAY 16 /* Array of pre-constructors */
|
||||||
#define SHT_GROUP 17 /* Section group */
|
#define SHT_GROUP 17 /* Section group */
|
||||||
#define SHT_SYMTAB_SHNDX 18 /* Extended section indeces */
|
#define SHT_SYMTAB_SHNDX 18 /* Extended section indices */
|
||||||
#define SHT_NUM 19 /* Number of defined types. */
|
#define SHT_NUM 19 /* Number of defined types. */
|
||||||
#define SHT_LOOS 0x60000000 /* Start OS-specific. */
|
#define SHT_LOOS 0x60000000 /* Start OS-specific. */
|
||||||
#define SHT_GNU_ATTRIBUTES 0x6ffffff5 /* Object attributes. */
|
#define SHT_GNU_ATTRIBUTES 0x6ffffff5 /* Object attributes. */
|
||||||
@ -871,7 +871,7 @@ typedef struct
|
|||||||
#define VER_NDX_LORESERVE 0xff00 /* Beginning of reserved entries. */
|
#define VER_NDX_LORESERVE 0xff00 /* Beginning of reserved entries. */
|
||||||
#define VER_NDX_ELIMINATE 0xff01 /* Symbol is to be eliminated. */
|
#define VER_NDX_ELIMINATE 0xff01 /* Symbol is to be eliminated. */
|
||||||
|
|
||||||
/* Auxialiary version information. */
|
/* Auxiliary version information. */
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@ -1776,9 +1776,9 @@ typedef Elf32_Addr Elf32_Conflict;
|
|||||||
#define EFA_PARISC_1_1 0x0210 /* PA-RISC 1.1 big-endian. */
|
#define EFA_PARISC_1_1 0x0210 /* PA-RISC 1.1 big-endian. */
|
||||||
#define EFA_PARISC_2_0 0x0214 /* PA-RISC 2.0 big-endian. */
|
#define EFA_PARISC_2_0 0x0214 /* PA-RISC 2.0 big-endian. */
|
||||||
|
|
||||||
/* Additional section indeces. */
|
/* Additional section indices. */
|
||||||
|
|
||||||
#define SHN_PARISC_ANSI_COMMON 0xff00 /* Section for tenatively declared
|
#define SHN_PARISC_ANSI_COMMON 0xff00 /* Section for tentatively declared
|
||||||
symbols in ANSI C. */
|
symbols in ANSI C. */
|
||||||
#define SHN_PARISC_HUGE_COMMON 0xff01 /* Common blocks in huge model. */
|
#define SHN_PARISC_HUGE_COMMON 0xff01 /* Common blocks in huge model. */
|
||||||
|
|
||||||
@ -1957,7 +1957,7 @@ typedef Elf32_Addr Elf32_Conflict;
|
|||||||
|
|
||||||
/* Legal values for sh_type field of Elf64_Shdr. */
|
/* Legal values for sh_type field of Elf64_Shdr. */
|
||||||
|
|
||||||
/* These two are primerily concerned with ECOFF debugging info. */
|
/* These two are primarily concerned with ECOFF debugging info. */
|
||||||
#define SHT_ALPHA_DEBUG 0x70000001
|
#define SHT_ALPHA_DEBUG 0x70000001
|
||||||
#define SHT_ALPHA_REGINFO 0x70000002
|
#define SHT_ALPHA_REGINFO 0x70000002
|
||||||
|
|
||||||
|
@ -1473,7 +1473,7 @@ ST_FUNC void subst_asm_operand(CString *add_str,
|
|||||||
if (r & VT_SYM) {
|
if (r & VT_SYM) {
|
||||||
const char *name = get_tok_str(sv->sym->v, NULL);
|
const char *name = get_tok_str(sv->sym->v, NULL);
|
||||||
if (sv->sym->v >= SYM_FIRST_ANOM) {
|
if (sv->sym->v >= SYM_FIRST_ANOM) {
|
||||||
/* In case of anonymuous symbols ("L.42", used
|
/* In case of anonymous symbols ("L.42", used
|
||||||
for static data labels) we can't find them
|
for static data labels) we can't find them
|
||||||
in the C symbol table when later looking up
|
in the C symbol table when later looking up
|
||||||
this name. So enter them now into the asm label
|
this name. So enter them now into the asm label
|
||||||
|
@ -174,7 +174,7 @@ ST_FUNC void gen_addrpc32(int r, Sym *sym, long c)
|
|||||||
gen_le32(c - 4);
|
gen_le32(c - 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* generate a modrm reference. 'op_reg' contains the addtionnal 3
|
/* generate a modrm reference. 'op_reg' contains the addtional 3
|
||||||
opcode bits */
|
opcode bits */
|
||||||
static void gen_modrm(int op_reg, int r, Sym *sym, int c)
|
static void gen_modrm(int op_reg, int r, Sym *sym, int c)
|
||||||
{
|
{
|
||||||
@ -890,7 +890,7 @@ ST_FUNC void gen_opi(int op)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* generate a floating point operation 'v = t1 op t2' instruction. The
|
/* generate a floating point operation 'v = t1 op t2' instruction. The
|
||||||
two operands are guaranted to have the same floating point type */
|
two operands are guaranteed to have the same floating point type */
|
||||||
/* XXX: need to use ST1 too */
|
/* XXX: need to use ST1 too */
|
||||||
ST_FUNC void gen_opf(int op)
|
ST_FUNC void gen_opf(int op)
|
||||||
{
|
{
|
||||||
|
@ -49,7 +49,7 @@ int code_reloc (int reloc_type)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns an enumerator to describe wether and when the relocation needs a
|
/* Returns an enumerator to describe whether and when the relocation needs a
|
||||||
GOT and/or PLT entry to be created. See tcc.h for a description of the
|
GOT and/or PLT entry to be created. See tcc.h for a description of the
|
||||||
different values. */
|
different values. */
|
||||||
int gotplt_entry_type (int reloc_type)
|
int gotplt_entry_type (int reloc_type)
|
||||||
@ -99,7 +99,7 @@ ST_FUNC unsigned create_plt_entry(TCCState *s1, unsigned got_offset, struct sym_
|
|||||||
else
|
else
|
||||||
modrm = 0x25;
|
modrm = 0x25;
|
||||||
|
|
||||||
/* empty PLT: create PLT0 entry that pushes the library indentifier
|
/* empty PLT: create PLT0 entry that pushes the library identifier
|
||||||
(GOT + PTR_SIZE) and jumps to ld.so resolution routine
|
(GOT + PTR_SIZE) and jumps to ld.so resolution routine
|
||||||
(GOT + 2 * PTR_SIZE) */
|
(GOT + 2 * PTR_SIZE) */
|
||||||
if (plt->data_offset == 0) {
|
if (plt->data_offset == 0) {
|
||||||
@ -229,9 +229,9 @@ void relocate(TCCState *s1, ElfW_Rel *rel, int type, unsigned char *ptr, addr_t
|
|||||||
/* do nothing */
|
/* do nothing */
|
||||||
return;
|
return;
|
||||||
case R_386_COPY:
|
case R_386_COPY:
|
||||||
/* This reloction must copy initialized data from the library
|
/* This relocation must copy initialized data from the library
|
||||||
to the program .bss segment. Currently made like for ARM
|
to the program .bss segment. Currently made like for ARM
|
||||||
(to remove noise of defaukt case). Is this true?
|
(to remove noise of default case). Is this true?
|
||||||
*/
|
*/
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
|
2
il-gen.c
2
il-gen.c
@ -602,7 +602,7 @@ void gen_opi(int op)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* generate a floating point operation 'v = t1 op t2' instruction. The
|
/* generate a floating point operation 'v = t1 op t2' instruction. The
|
||||||
two operands are guaranted to have the same floating point type */
|
two operands are guaranteed to have the same floating point type */
|
||||||
void gen_opf(int op)
|
void gen_opf(int op)
|
||||||
{
|
{
|
||||||
/* same as integer */
|
/* same as integer */
|
||||||
|
4
libtcc.c
4
libtcc.c
@ -1176,7 +1176,7 @@ PUB_FUNC int tcc_add_library_err(TCCState *s, const char *libname)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* habdle #pragma comment(lib,) */
|
/* handle #pragma comment(lib,) */
|
||||||
ST_FUNC void tcc_add_pragma_libs(TCCState *s1)
|
ST_FUNC void tcc_add_pragma_libs(TCCState *s1)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -1287,7 +1287,7 @@ static int link_option(const char *str, const char *val, const char **ptr)
|
|||||||
if (*str == '-')
|
if (*str == '-')
|
||||||
str++;
|
str++;
|
||||||
|
|
||||||
/* then str & val should match (potentialy up to '=') */
|
/* then str & val should match (potentially up to '=') */
|
||||||
p = str;
|
p = str;
|
||||||
q = val;
|
q = val;
|
||||||
|
|
||||||
|
12
tcc.h
12
tcc.h
@ -601,7 +601,7 @@ typedef struct ExprValue {
|
|||||||
|
|
||||||
#define MAX_ASM_OPERANDS 30
|
#define MAX_ASM_OPERANDS 30
|
||||||
typedef struct ASMOperand {
|
typedef struct ASMOperand {
|
||||||
int id; /* GCC 3 optionnal identifier (0 if number only supported */
|
int id; /* GCC 3 optional identifier (0 if number only supported */
|
||||||
char *constraint;
|
char *constraint;
|
||||||
char asm_str[16]; /* computed asm string for operand */
|
char asm_str[16]; /* computed asm string for operand */
|
||||||
SValue *vt; /* C value of the expression */
|
SValue *vt; /* C value of the expression */
|
||||||
@ -651,7 +651,7 @@ struct TCCState {
|
|||||||
int char_is_unsigned;
|
int char_is_unsigned;
|
||||||
int leading_underscore;
|
int leading_underscore;
|
||||||
int ms_extensions; /* allow nested named struct w/o identifier behave like unnamed */
|
int ms_extensions; /* allow nested named struct w/o identifier behave like unnamed */
|
||||||
int dollars_in_identifiers; /* allows '$' char in indentifiers */
|
int dollars_in_identifiers; /* allows '$' char in identifiers */
|
||||||
int ms_bitfields; /* if true, emulate MS algorithm for aligning bitfields */
|
int ms_bitfields; /* if true, emulate MS algorithm for aligning bitfields */
|
||||||
|
|
||||||
/* warning switches */
|
/* warning switches */
|
||||||
@ -768,7 +768,7 @@ struct TCCState {
|
|||||||
Section *dynsymtab_section;
|
Section *dynsymtab_section;
|
||||||
/* exported dynamic symbol section */
|
/* exported dynamic symbol section */
|
||||||
Section *dynsym;
|
Section *dynsym;
|
||||||
/* copy of the gobal symtab_section variable */
|
/* copy of the global symtab_section variable */
|
||||||
Section *symtab;
|
Section *symtab;
|
||||||
/* extra attributes (eg. GOT/PLT value) for symtab symbols */
|
/* extra attributes (eg. GOT/PLT value) for symtab symbols */
|
||||||
struct sym_attr *sym_attrs;
|
struct sym_attr *sym_attrs;
|
||||||
@ -945,7 +945,7 @@ struct filespec {
|
|||||||
#define TOK_SHL 0x01 /* shift left */
|
#define TOK_SHL 0x01 /* shift left */
|
||||||
#define TOK_SAR 0x02 /* signed shift right */
|
#define TOK_SAR 0x02 /* signed shift right */
|
||||||
|
|
||||||
/* assignement operators : normal operator or 0x80 */
|
/* assignment operators : normal operator or 0x80 */
|
||||||
#define TOK_A_MOD 0xa5
|
#define TOK_A_MOD 0xa5
|
||||||
#define TOK_A_AND 0xa6
|
#define TOK_A_AND 0xa6
|
||||||
#define TOK_A_MUL 0xaa
|
#define TOK_A_MUL 0xaa
|
||||||
@ -968,7 +968,7 @@ struct filespec {
|
|||||||
#define TOK_EOF (-1) /* end of file */
|
#define TOK_EOF (-1) /* end of file */
|
||||||
#define TOK_LINEFEED 10 /* line feed */
|
#define TOK_LINEFEED 10 /* line feed */
|
||||||
|
|
||||||
/* all identificators and strings have token above that */
|
/* all identifiers and strings have token above that */
|
||||||
#define TOK_IDENT 256
|
#define TOK_IDENT 256
|
||||||
|
|
||||||
#define DEF_ASM(x) DEF(TOK_ASM_ ## x, #x)
|
#define DEF_ASM(x) DEF(TOK_ASM_ ## x, #x)
|
||||||
@ -1241,7 +1241,7 @@ ST_FUNC int tcc_preprocess(TCCState *s1);
|
|||||||
ST_FUNC void skip(int c);
|
ST_FUNC void skip(int c);
|
||||||
ST_FUNC NORETURN void expect(const char *msg);
|
ST_FUNC NORETURN void expect(const char *msg);
|
||||||
|
|
||||||
/* space exlcuding newline */
|
/* space excluding newline */
|
||||||
static inline int is_space(int ch) {
|
static inline int is_space(int ch) {
|
||||||
return ch == ' ' || ch == '\t' || ch == '\v' || ch == '\f' || ch == '\r';
|
return ch == ' ' || ch == '\t' || ch == '\v' || ch == '\f' || ch == '\r';
|
||||||
}
|
}
|
||||||
|
2
tccelf.c
2
tccelf.c
@ -151,7 +151,7 @@ ST_FUNC Section *new_section(TCCState *s1, const char *name, int sh_type, int sh
|
|||||||
sec->sh_addralign = 1;
|
sec->sh_addralign = 1;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
sec->sh_addralign = PTR_SIZE; /* gcc/pcc default aligment */
|
sec->sh_addralign = PTR_SIZE; /* gcc/pcc default alignment */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
12
tccgen.c
12
tccgen.c
@ -257,7 +257,7 @@ ST_FUNC void tccgen_end(TCCState *s1)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------- */
|
/* ------------------------------------------------------------------------- */
|
||||||
/* apply storage attibutes to Elf symbol */
|
/* apply storage attributes to Elf symbol */
|
||||||
|
|
||||||
static void update_storage(Sym *sym)
|
static void update_storage(Sym *sym)
|
||||||
{
|
{
|
||||||
@ -1532,7 +1532,7 @@ static void gen_opl(int op)
|
|||||||
c = (int)vtop->c.i;
|
c = (int)vtop->c.i;
|
||||||
/* constant: simpler */
|
/* constant: simpler */
|
||||||
/* NOTE: all comments are for SHL. the other cases are
|
/* NOTE: all comments are for SHL. the other cases are
|
||||||
done by swaping words */
|
done by swapping words */
|
||||||
vpop();
|
vpop();
|
||||||
if (op != TOK_SHL)
|
if (op != TOK_SHL)
|
||||||
vswap();
|
vswap();
|
||||||
@ -1973,7 +1973,7 @@ redo:
|
|||||||
goto redo;
|
goto redo;
|
||||||
} else if (bt1 == VT_PTR || bt2 == VT_PTR) {
|
} else if (bt1 == VT_PTR || bt2 == VT_PTR) {
|
||||||
/* at least one operand is a pointer */
|
/* at least one operand is a pointer */
|
||||||
/* relationnal op: must be both pointers */
|
/* relational op: must be both pointers */
|
||||||
if (op >= TOK_ULT && op <= TOK_LOR) {
|
if (op >= TOK_ULT && op <= TOK_LOR) {
|
||||||
check_comparison_pointer_types(vtop - 1, vtop, op);
|
check_comparison_pointer_types(vtop - 1, vtop, op);
|
||||||
/* pointers are handled are unsigned */
|
/* pointers are handled are unsigned */
|
||||||
@ -2137,7 +2137,7 @@ redo:
|
|||||||
else
|
else
|
||||||
gen_opic(op);
|
gen_opic(op);
|
||||||
if (op >= TOK_ULT && op <= TOK_GT) {
|
if (op >= TOK_ULT && op <= TOK_GT) {
|
||||||
/* relationnal op: the result is an int */
|
/* relational op: the result is an int */
|
||||||
vtop->type.t = VT_INT;
|
vtop->type.t = VT_INT;
|
||||||
} else {
|
} else {
|
||||||
vtop->type.t = t;
|
vtop->type.t = t;
|
||||||
@ -2794,7 +2794,7 @@ static void gen_assign_cast(CType *dt)
|
|||||||
goto type_ok;
|
goto type_ok;
|
||||||
}
|
}
|
||||||
type1 = pointed_type(dt);
|
type1 = pointed_type(dt);
|
||||||
/* a function is implicitely a function pointer */
|
/* a function is implicitly a function pointer */
|
||||||
if (sbt == VT_FUNC) {
|
if (sbt == VT_FUNC) {
|
||||||
if ((type1->t & VT_BTYPE) != VT_VOID &&
|
if ((type1->t & VT_BTYPE) != VT_VOID &&
|
||||||
!is_compatible_types(pointed_type(dt), st))
|
!is_compatible_types(pointed_type(dt), st))
|
||||||
@ -6086,7 +6086,7 @@ static void init_putv(CType *type, Section *sec, unsigned long c)
|
|||||||
}
|
}
|
||||||
if ((vtop->r & (VT_SYM|VT_CONST)) == (VT_SYM|VT_CONST) &&
|
if ((vtop->r & (VT_SYM|VT_CONST)) == (VT_SYM|VT_CONST) &&
|
||||||
vtop->sym->v >= SYM_FIRST_ANOM &&
|
vtop->sym->v >= SYM_FIRST_ANOM &&
|
||||||
/* XXX This rejects compount literals like
|
/* XXX This rejects compound literals like
|
||||||
'(void *){ptr}'. The problem is that '&sym' is
|
'(void *){ptr}'. The problem is that '&sym' is
|
||||||
represented the same way, which would be ruled out
|
represented the same way, which would be ruled out
|
||||||
by the SYM_FIRST_ANOM check above, but also '"string"'
|
by the SYM_FIRST_ANOM check above, but also '"string"'
|
||||||
|
4
tccpe.c
4
tccpe.c
@ -1333,7 +1333,7 @@ static int pe_check_symbols(struct pe_info *pe)
|
|||||||
#ifdef PE_PRINT_SECTIONS
|
#ifdef PE_PRINT_SECTIONS
|
||||||
static void pe_print_section(FILE * f, Section * s)
|
static void pe_print_section(FILE * f, Section * s)
|
||||||
{
|
{
|
||||||
/* just if you'r curious */
|
/* just if you're curious */
|
||||||
BYTE *p, *e, b;
|
BYTE *p, *e, b;
|
||||||
int i, n, l, m;
|
int i, n, l, m;
|
||||||
p = s->data;
|
p = s->data;
|
||||||
@ -1976,7 +1976,7 @@ ST_FUNC int pe_output_file(TCCState *s1, const char *filename)
|
|||||||
|
|
||||||
tcc_add_bcheck(s1);
|
tcc_add_bcheck(s1);
|
||||||
pe_add_runtime(s1, &pe);
|
pe_add_runtime(s1, &pe);
|
||||||
relocate_common_syms(); /* assign bss adresses */
|
relocate_common_syms(); /* assign bss addresses */
|
||||||
tcc_add_linker_symbols(s1);
|
tcc_add_linker_symbols(s1);
|
||||||
pe_set_options(s1, &pe);
|
pe_set_options(s1, &pe);
|
||||||
|
|
||||||
|
4
tccpp.c
4
tccpp.c
@ -2993,10 +2993,10 @@ static int *macro_arg_subst(Sym **nested_list, const int *macro_str, Sym *args)
|
|||||||
} else {
|
} else {
|
||||||
add_var:
|
add_var:
|
||||||
/* NOTE: the stream cannot be read when macro
|
/* NOTE: the stream cannot be read when macro
|
||||||
substituing an argument */
|
substituting an argument */
|
||||||
macro_subst(&str, nested_list, st, 0);
|
macro_subst(&str, nested_list, st, 0);
|
||||||
}
|
}
|
||||||
if (str.len == l0) /* exanded to empty string */
|
if (str.len == l0) /* expanded to empty string */
|
||||||
tok_str_add(&str, TOK_PLCHLDR);
|
tok_str_add(&str, TOK_PLCHLDR);
|
||||||
} else {
|
} else {
|
||||||
tok_str_add(&str, t);
|
tok_str_add(&str, t);
|
||||||
|
@ -316,14 +316,14 @@ static void gen_modrm_impl(int op_reg, int r, Sym *sym, int c, int is_got)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* generate a modrm reference. 'op_reg' contains the addtionnal 3
|
/* generate a modrm reference. 'op_reg' contains the addtional 3
|
||||||
opcode bits */
|
opcode bits */
|
||||||
static void gen_modrm(int op_reg, int r, Sym *sym, int c)
|
static void gen_modrm(int op_reg, int r, Sym *sym, int c)
|
||||||
{
|
{
|
||||||
gen_modrm_impl(op_reg, r, sym, c, 0);
|
gen_modrm_impl(op_reg, r, sym, c, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* generate a modrm reference. 'op_reg' contains the addtionnal 3
|
/* generate a modrm reference. 'op_reg' contains the addtional 3
|
||||||
opcode bits */
|
opcode bits */
|
||||||
static void gen_modrm64(int opcode, int op_reg, int r, Sym *sym, int c)
|
static void gen_modrm64(int opcode, int op_reg, int r, Sym *sym, int c)
|
||||||
{
|
{
|
||||||
@ -1923,7 +1923,7 @@ void gen_opl(int op)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* generate a floating point operation 'v = t1 op t2' instruction. The
|
/* generate a floating point operation 'v = t1 op t2' instruction. The
|
||||||
two operands are guaranted to have the same floating point type */
|
two operands are guaranteed to have the same floating point type */
|
||||||
/* XXX: need to use ST1 too */
|
/* XXX: need to use ST1 too */
|
||||||
void gen_opf(int op)
|
void gen_opf(int op)
|
||||||
{
|
{
|
||||||
|
@ -50,7 +50,7 @@ int code_reloc (int reloc_type)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns an enumerator to describe wether and when the relocation needs a
|
/* Returns an enumerator to describe whether and when the relocation needs a
|
||||||
GOT and/or PLT entry to be created. See tcc.h for a description of the
|
GOT and/or PLT entry to be created. See tcc.h for a description of the
|
||||||
different values. */
|
different values. */
|
||||||
int gotplt_entry_type (int reloc_type)
|
int gotplt_entry_type (int reloc_type)
|
||||||
@ -95,7 +95,7 @@ ST_FUNC unsigned create_plt_entry(TCCState *s1, unsigned got_offset, struct sym_
|
|||||||
|
|
||||||
modrm = 0x25;
|
modrm = 0x25;
|
||||||
|
|
||||||
/* empty PLT: create PLT0 entry that pushes the library indentifier
|
/* empty PLT: create PLT0 entry that pushes the library identifier
|
||||||
(GOT + PTR_SIZE) and jumps to ld.so resolution routine
|
(GOT + PTR_SIZE) and jumps to ld.so resolution routine
|
||||||
(GOT + 2 * PTR_SIZE) */
|
(GOT + 2 * PTR_SIZE) */
|
||||||
if (plt->data_offset == 0) {
|
if (plt->data_offset == 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user