mirror of
https://github.com/frida/tinycc
synced 2024-11-28 02:29:38 +03:00
unbounded section name (might be useful when section name contains function name for g++ linkonce sections)
This commit is contained in:
parent
c5ce5eaeda
commit
d369a77647
6
tcc.c
6
tcc.c
@ -175,7 +175,7 @@ typedef struct Section {
|
|||||||
struct Section *reloc; /* corresponding section for relocation, if any */
|
struct Section *reloc; /* corresponding section for relocation, if any */
|
||||||
struct Section *hash; /* hash table for symbols */
|
struct Section *hash; /* hash table for symbols */
|
||||||
struct Section *next;
|
struct Section *next;
|
||||||
char name[64]; /* section name */
|
char name[1]; /* section name */
|
||||||
} Section;
|
} Section;
|
||||||
|
|
||||||
typedef struct DLLReference {
|
typedef struct DLLReference {
|
||||||
@ -964,8 +964,8 @@ Section *new_section(TCCState *s1, const char *name, int sh_type, int sh_flags)
|
|||||||
{
|
{
|
||||||
Section *sec;
|
Section *sec;
|
||||||
|
|
||||||
sec = tcc_mallocz(sizeof(Section));
|
sec = tcc_mallocz(sizeof(Section) + strlen(name));
|
||||||
pstrcpy(sec->name, sizeof(sec->name), name);
|
strcpy(sec->name, name);
|
||||||
sec->sh_type = sh_type;
|
sec->sh_type = sh_type;
|
||||||
sec->sh_flags = sh_flags;
|
sec->sh_flags = sh_flags;
|
||||||
switch(sh_type) {
|
switch(sh_type) {
|
||||||
|
Loading…
Reference in New Issue
Block a user