aboutsummaryrefslogtreecommitdiff
path: root/tcc.c
diff options
context:
space:
mode:
authorbellard <bellard>2003-10-04 14:41:18 +0000
committerbellard <bellard>2003-10-04 14:41:18 +0000
commitd369a77647c93fabd2385004a2b988748e8b982e (patch)
treefc29df3e62d374cee89d90ef6ac6eaebb7313067 /tcc.c
parentc5ce5eaedae46467f6e538e4e5b25910b863de75 (diff)
downloadtinycc-d369a77647c93fabd2385004a2b988748e8b982e.tar.gz
tinycc-d369a77647c93fabd2385004a2b988748e8b982e.tar.bz2
unbounded section name (might be useful when section name contains function name for g++ linkonce sections)
Diffstat (limited to 'tcc.c')
-rw-r--r--tcc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tcc.c b/tcc.c
index 3195802..b5860c3 100644
--- a/tcc.c
+++ b/tcc.c
@@ -175,7 +175,7 @@ typedef struct Section {
struct Section *reloc; /* corresponding section for relocation, if any */
struct Section *hash; /* hash table for symbols */
struct Section *next;
- char name[64]; /* section name */
+ char name[1]; /* section name */
} Section;
typedef struct DLLReference {
@@ -964,8 +964,8 @@ Section *new_section(TCCState *s1, const char *name, int sh_type, int sh_flags)
{
Section *sec;
- sec = tcc_mallocz(sizeof(Section));
- pstrcpy(sec->name, sizeof(sec->name), name);
+ sec = tcc_mallocz(sizeof(Section) + strlen(name));
+ strcpy(sec->name, name);
sec->sh_type = sh_type;
sec->sh_flags = sh_flags;
switch(sh_type) {