https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91252
Bug ID: 91252 Summary: [Bug] When use -flto "weak symbol" are converted to "t". Product: gcc Version: lto Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: akhilesh.k at samsung dot com Target Milestone: --- when i use -flto "weak symbol" are converted to "t". I really don't know whether this is bug or expected behavior, because in GCC Source i am not able to find the code for this conversion. @akhilesh-ubuntu:~/akhilesh/lto$ gcc -flto -o nornal myapp.c; nm -C ./nornal | grep power 0000000000400532 t power @akhilesh-ubuntu:~/akhilesh/lto$ gcc -o nornal myapp.c; nm -C ./nornal | grep power 0000000000400532 W power @akhilesh-ubuntu:~/akhilesh/lto$ ================================================ @akhilesh-ubuntu:~/akhilesh/lto$ cat myapp.c #include <stdio.h> #include <stdlib.h> int __attribute__((weak)) power(int x); int power(int x) { return x*x; } int main(int argc, char **argv) { printf("power() = %d\n", power(atoi(argv[1]))); return 0; } ============================================================= @akhilesh-ubuntu:~/akhilesh/lto$ I am using gcc 8.3.0 version and binutils version is 2.29.1 @akhilesh-ubuntu:~/akhilesh/lto$ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-pc-linux-gnu/8.3.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-arm-src-snapshot-8.3-2019.03/configure --disable-multilib Thread model: posix gcc version 8.3.0 (Linaro GCC 8.2-2018.08~d