Created attachment 7770 [details] testcase The attached testcase has a .init_array that is in a comdat. With gold $ ~/binutils/build/gold/ld-new -shared -o test.so test.o $ readelf -x .init_array test.so Hex dump of section '.init_array': 0x00001468 90020000 00000000 ........ $ readelf -sDW test.so | grep FUNC 1 0: 0000000000000290 1 FUNC WEAK DEFAULT 7 f That is, .init_array points to the function f, as expected. With bfd ld: $ ~/binutils/build/ld/ld-new -shared -o test.so test.o [espindola@localhost llvm]$ readelf -x .init_array test.so Hex dump of section '.init_array': 0x00200268 00000000 00000000 ........ The section has a null. As to why this is useful: In C++ when doing static initialization of a variable in a comdat we can put the .init_array in that comdat. That way the linker should keep only one copy.
Both ld.bfd and ld.gold produce a shared library with a dynamic relocation against "f" on the first element of .init_array. Seems to me that section contents don't matter.
You are right. Sorry for the noise, I forgot this relocation was using Rela format and the value in the relocated position was not relevant.