https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69866
Thomas Preud'homme <thopre01 at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed|2016-02-19 00:00:00 |2016-7-20 CC| |thopre01 at gcc dot gnu.org --- Comment #5 from Thomas Preud'homme <thopre01 at gcc dot gnu.org> --- I can indeed reproduce that bug with latest gcc-5-branch either by compiling the below testcase, or by building ChibiOS 3.0.4 as described in https://answers.launchpad.net/gcc-arm-embedded/+question/280242 Best regards. (In reply to acrsofter from comment #3) > reproduce steps: > > [foo.c] > > int _umh(int i) > { > return i+1; > } > > int weaks(int i) __attribute__((weak, alias("_umh"))); > > int main() > { > return weaks(10); > } > > > [bar.c] > > int weaks(int i) > { > return i+1; > } > > > now compile: > > gcc -c bar.c > > gcc -flto -c foo.c > > gcc -flto -o elf bar.o foo.o > > > note: > > bar compiled without flt > but rest with flt > > > now at linking stage booms > at line > > gcc_assert (c != SYMBOL_EXTERNAL > && (c == SYMBOL_DUPLICATE || !symbol_partitioned_p (node))); > > in lto/lto-partition.c > > =============================================================== > > same code compiled without lto ok > > gcc 4.9.3 not affected > but 5.3.0 affected and latest (gcc-6-20160214) affected