fill got table for static linking

This commit is contained in:
Ali Gholami Rudi
2010-02-04 23:08:01 +03:30
parent b9aeac0a64
commit d63ec6f20d
3 changed files with 54 additions and 0 deletions

View File

@ -372,6 +372,15 @@ ST_FUNC void *section_ptr_add(Section *sec, unsigned long size)
return sec->data + offset;
}
/* reserve at least 'size' bytes from section start */
ST_FUNC void section_reserve(Section *sec, unsigned long size)
{
if (size > sec->data_allocated)
section_realloc(sec, size);
if (size > sec->data_offset)
sec->data_offset = size;
}
/* return a reference to a section, and create it if it does not
exists */
ST_FUNC Section *find_section(TCCState *s1, const char *name)