aboutsummaryrefslogtreecommitdiff
path: root/tccelf.c
diff options
context:
space:
mode:
authorgrischka <grischka>2016-10-17 23:24:01 +0200
committergrischka <grischka>2016-10-17 23:24:01 +0200
commit0be098929a062d706057d7beb78666daa52bac49 (patch)
tree107fa3e4efaf0c080e66475ec50299b8da45f0bd /tccelf.c
parent6fbcc14a5d39ca91228f88a64d68a1f3c2d67293 (diff)
downloadtinycc-0be098929a062d706057d7beb78666daa52bac49.tar.gz
tinycc-0be098929a062d706057d7beb78666daa52bac49.tar.bz2
tccpp_new/delete and other cleanups
Diffstat (limited to 'tccelf.c')
-rw-r--r--tccelf.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/tccelf.c b/tccelf.c
index 8fe40c9..a8ae48a 100644
--- a/tccelf.c
+++ b/tccelf.c
@@ -69,6 +69,28 @@ ST_FUNC void tccelf_new(TCCState *s)
".dynhashtab", SHF_PRIVATE);
}
+#ifdef CONFIG_TCC_BCHECK
+ST_FUNC void tccelf_bounds_new(TCCState *s)
+{
+ /* create bounds sections */
+ bounds_section = new_section(s, ".bounds",
+ SHT_PROGBITS, SHF_ALLOC);
+ lbounds_section = new_section(s, ".lbounds",
+ SHT_PROGBITS, SHF_ALLOC);
+}
+#endif
+
+ST_FUNC void tccelf_stab_new(TCCState *s)
+{
+ stab_section = new_section(s, ".stab", SHT_PROGBITS, 0);
+ stab_section->sh_entsize = sizeof(Stab_Sym);
+ stabstr_section = new_section(s, ".stabstr", SHT_STRTAB, 0);
+ put_elf_str(stabstr_section, "");
+ stab_section->link = stabstr_section;
+ /* put first entry */
+ put_stabs("", 0, 0, 0, 0);
+}
+
static void free_section(Section *s)
{
tcc_free(s->data);
@@ -616,7 +638,7 @@ ST_FUNC void relocate_syms(TCCState *s1, int do_resolve)
name = (char *) strtab_section->data + sym->st_name;
/* Use ld.so to resolve symbol for us (for tcc -run) */
if (do_resolve) {
-#if defined TCC_IS_NATIVE && !defined _WIN32
+#if defined TCC_IS_NATIVE && !defined TCC_TARGET_PE
void *addr;
name = (char *) symtab_section->link->data + sym->st_name;
addr = dlsym(RTLD_DEFAULT, name);
@@ -1786,7 +1808,7 @@ ST_FUNC void tcc_add_runtime(TCCState *s1)
tcc_add_pragma_libs(s1);
/* add libc */
if (!s1->nostdlib) {
- tcc_add_library(s1, "c");
+ tcc_add_library_err(s1, "c");
#ifdef CONFIG_USE_LIBGCC
if (!s1->static_link) {
tcc_add_file(s1, TCC_LIBGCC);