aboutsummaryrefslogtreecommitdiff
path: root/tccelf.c
diff options
context:
space:
mode:
authorThomas Preud'homme <thomas.preudhomme@celest.fr>2011-05-16 14:15:32 +0200
committerThomas Preud'homme <thomas.preudhomme@celest.fr>2011-05-16 14:15:32 +0200
commitee06ef9dd394f26b11fef078f07c635a02fd95d6 (patch)
treeff9839a42156909393bd121ade708221358377e7 /tccelf.c
parentdb9d5f0fa4dc65bbf869ee4f98f53eafbab6059f (diff)
downloadtinycc-ee06ef9dd394f26b11fef078f07c635a02fd95d6.tar.gz
tinycc-ee06ef9dd394f26b11fef078f07c635a02fd95d6.tar.bz2
Remove unused variables
Remove unused local variables and declare them conditionally when they are used only on some architectures.
Diffstat (limited to 'tccelf.c')
-rw-r--r--tccelf.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/tccelf.c b/tccelf.c
index e6f4f8f..8d91daa 100644
--- a/tccelf.c
+++ b/tccelf.c
@@ -1033,7 +1033,7 @@ static void put_got_entry(TCCState *s1,
/* build GOT and PLT entries */
ST_FUNC void build_got_entries(TCCState *s1)
{
- Section *s, *symtab;
+ Section *s;
ElfW_Rel *rel, *rel_end;
ElfW(Sym) *sym;
int i, type, reloc_type, sym_index;
@@ -1045,7 +1045,6 @@ ST_FUNC void build_got_entries(TCCState *s1)
/* no need to handle got relocations */
if (s->link != symtab_section)
continue;
- symtab = s->link;
rel_end = (ElfW_Rel *)(s->data + s->data_offset);
for(rel = (ElfW_Rel *)s->data;
rel < rel_end;
@@ -1456,7 +1455,9 @@ static int elf_output_file(TCCState *s1, const char *filename)
ElfW(Sym) *sym;
int type, file_type;
unsigned long rel_addr, rel_size;
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
unsigned long bss_addr, bss_size;
+#endif
file_type = s1->output_type;
s1->nb_errors = 0;
@@ -1788,7 +1789,9 @@ static int elf_output_file(TCCState *s1, const char *filename)
rel_size = 0;
rel_addr = 0;
- bss_addr = bss_size = 0;
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ bss_addr = bss_size = 0;
+#endif
/* leave one program header for the program interpreter */
ph = &phdr[0];
if (interp)