From 60eac659d42b27a67c6f2d8677ddee863ba2bbda Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Thu, 31 Dec 2020 00:16:23 +0100 Subject: [PATCH] fix cross compiler compilation {l,}bounds_section is only conditionally defined. --- tccelf.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tccelf.c b/tccelf.c index 671215e8..698a333d 100644 --- a/tccelf.c +++ b/tccelf.c @@ -1957,8 +1957,11 @@ static int layout_sections(TCCState *s1, ElfW(Phdr) *phdr, if (k != 6) continue; } else if (s == data_ro_section || +#ifdef CONFIG_TCC_BCHECK s == bounds_section || - s == lbounds_section) { + s == lbounds_section || +#endif + 0) { if (k != 4) continue; } else { @@ -1988,8 +1991,11 @@ static int layout_sections(TCCState *s1, ElfW(Phdr) *phdr, dyninf->rel_size = (addr - dyninf->rel_addr) + s->sh_size; } if (s == data_ro_section || +#ifdef CONFIG_TCC_BCHECK s == bounds_section || - s == lbounds_section) { + s == lbounds_section || +#endif + 0) { if (roinf->sh_size == 0) { roinf->sh_offset = s->sh_offset; roinf->sh_addr = s->sh_addr;