Lines Matching refs:sec
5412 static void decl_initializer(CType *type, Section *sec, unsigned long c,
5461 static Sym *get_sym_ref(CType *type, Section *sec,
5466 static void section_realloc(Section *sec, unsigned long new_size);
5467 static void *section_ptr_add(Section *sec, unsigned long size);
5482 unsigned long value, Section *sec, int sym_index);
6820 Section *sec;
6822 sec = tcc_mallocz(sizeof(Section) + strlen(name));
6823 strcpy(sec->name, name);
6824 sec->sh_type = sh_type;
6825 sec->sh_flags = sh_flags;
6832 sec->sh_addralign = 4;
6835 sec->sh_addralign = 1;
6838 sec->sh_addralign = 32; /* default conservative alignment */
6844 sec->sh_num = s1->nb_sections;
6845 dynarray_add((void ***)&s1->sections, &s1->nb_sections, sec);
6847 return sec;
6857 static void section_realloc(Section *sec, unsigned long new_size)
6862 size = sec->data_allocated;
6867 data = tcc_realloc(sec->data, size);
6870 memset(data + sec->data_allocated, 0, size - sec->data_allocated);
6871 sec->data = data;
6872 sec->data_allocated = size;
6875 /* reserve at least 'size' bytes in section 'sec' from
6876 sec->data_offset. */
6877 static void *section_ptr_add(Section *sec, unsigned long size)
6881 offset = sec->data_offset;
6883 if (offset1 > sec->data_allocated)
6884 section_realloc(sec, offset1);
6885 sec->data_offset = offset1;
6886 return sec->data + offset;
6893 Section *sec;
6896 sec = s1->sections[i];
6897 if (!strcmp(name, sec->name))
6898 sec;
10135 static Sym *get_sym_ref(CType *type, Section *sec,
10145 put_extern_sym(sym, sec, offset, size);
10150 static void vpush_ref(CType *type, Section *sec, unsigned long offset, unsigned long size)
10156 vtop->sym = get_sym_ref(type, sec, offset, size);
13845 static void decl_designator(CType *type, Section *sec, unsigned long c,
13939 decl_initializer(type, sec, c, 0, size_only);
13947 if (!sec)
13950 if (c_end > sec->data_allocated)
13951 section_realloc(sec, c_end);
13952 src = sec->data + c;
13966 static void init_putv(CType *type, Section *sec, unsigned long c,
13996 if (sec) {
14001 ptr = sec->data + c;
14038 greloc(sec, vtop->sym, c, R_DATA_32);
14053 static void init_putz(CType *t, Section *sec, unsigned long c, int size)
14055 if (sec) {
14067 object in section 'sec'. If 'sec' is NULL, it means stack based
14071 static void decl_initializer(CType *type, Section *sec, unsigned long c,
14119 if (sec && tok == TOK_STR && size1 == 1) {
14120 memcpy(sec->data + c + array_length, cstr->data, nb);
14127 init_putv(t1, sec, c + (array_length + i) * size1,
14139 init_putv(t1, sec, c + (array_length * size1), 0, EXPR_VAL);
14146 decl_designator(type, sec, c, &index, NULL, size_only);
14152 init_putz(t1, sec, c + array_length * size1,
14172 init_putz(t1, sec, c + array_length * size1,
14179 (sec || !first || tok == '{')) {
14219 decl_designator(type, sec, c, NULL, &f, size_only);
14222 init_putz(type, sec, c + array_length,
14237 init_putz(type, sec, c + array_length,
14248 decl_initializer(type, sec, c, first, size_only);
14265 if (!sec)
14267 init_putv(type, sec, c, 0, expr_type);
14285 Section *sec;
14347 sec = NULL;
14406 sec = ad->section;
14407 if (!sec) {
14409 sec = data_section;
14411 sec = bss_section;
14413 if (sec) {
14414 data_offset = sec->data_offset;
14423 sec->data_offset = data_offset;
14425 if (sec->sh_type != SHT_NOBITS &&
14426 data_offset > sec->data_allocated)
14427 section_realloc(sec, data_offset);
14429 if (align > sec->sh_addralign)
14430 sec->sh_addralign = align;
14444 if (sec) {
14445 put_extern_sym(sym, sec, addr, size);
14458 sym = get_sym_ref(type, sec, addr, size);
14477 decl_initializer(type, sec, addr, 1, 0);
17374 Section *sec;
17381 sec = SECTION_ABS;
17383 sec = st->sections[s->r];
17384 put_extern_sym2(s, sec, (long)s->next, 0, 0);
17393 static void use_section1(TCCState *s1, Section *sec)
17396 cur_text_section = sec;
17402 Section *sec;
17403 sec = find_section(s1, name);
17404 use_section1(s1, sec);
17410 Section *sec;
17415 sec = cur_text_section;
17429 if (sec->sh_addralign < n)
17430 sec->sh_addralign = n;
17440 if (sec->sh_type != SHT_NOBITS) {
17441 sec->data_offset = ind;
17442 ptr = section_ptr_add(sec, size);
17462 if (sec->sh_type != SHT_NOBITS) {
17489 if (sec->sh_type != SHT_NOBITS) {
17648 Section *sec;
17652 sec = cur_text_section;
17654 last_text_section = sec;
18403 unsigned long value, Section *sec, int sym_index)