I am working on a small C++ project. After a while my code started producing the following warnings when compiled and run in debug mode:
BFD: warning: /root/Projects/TestProject: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000002
BFD: warning: /lib64/ld-linux-x86-64.so.2: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000002
BFD: warning: /lib/x86_64-linux-gnu/libgcc_s.so.1: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000002
BFD: warning: /lib/x86_64-linux-gnu/libc.so.6: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000002
I am not sure why these warnings show up or what exactly they mean. The application seems to run fine even with these errors. Is there any information about these warnings?
I am on Ubuntu 20.04 and the used GCC version is gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04). The project needs to be run as root for user (if that might matter.)
I am using the __builtin_popcount function somewhere in my code. I noticed that by commenting the line of code containing this function 1 warning disappears:
BFD: warning: /lib/x86_64-linux-gnu/libgcc_s.so.1: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000002
The project is compiled with the following commands:
/usr/bin/c++ -g -std=gnu++11 -o CMakeFiles/project.dir/src/main.cpp.o -c /root/Projects/TestProject/src/main.cpp
/usr/bin/c++ -g -std=gnu++11 -o CMakeFiles/project.dir/src/file1.cpp.o -c /root/Projects/TestProject/src/file1.cpp
/usr/bin/c++ -g -std=gnu++11 -o CMakeFiles/project.dir/src/file2.cpp.o -c /root/Projects/TestProject/src/file2.cpp
/usr/bin/c++ -g CMakeFiles/project.dir/src/main.cpp.o CMakeFiles/project.dir/src/file1.cpp.o CMakeFiles/project.dir/src/file2.cpp.o -o TestApplication
ld version:
$ ld.bfd -v
GNU ld (GNU Binutils for Ubuntu) 2.34
Edit:
Tried linking with gold
/usr/bin/c++ -fuse-ld=gold -g CMakeFiles/project.dir/src/main.cpp.o CMakeFiles/project.dir/src/file1.cpp.o CMakeFiles/project.dir/src/file2.cpp.o -o TestApplication
This produces the same warnings. No extra information is given.
gold version:
$ gold -v
GNU gold (GNU Binutils for Ubuntu 2.34) 1.16
lld
orgold
, instead of the defaultld.bfd
might give you a better insight on what is happening with your code. In order to get the compiler to link using a different linker, try invokinggcc
orclang
with-fuse-ld=lld
or-fuse-ld=gold
ld.bfd
you are using. In my experience these kinds of warning start to happen when the linker is too old.