[hjl@gnu-cfl-1 ld]$ cat x.c void foo (void) { } [hjl@gnu-cfl-1 ld]$ cat y.c void bar (void) { } [hjl@gnu-cfl-1 ld]$ gcc -fPIC -c -fcf-protection x.c -Wa,-mx86-used-note=no [hjl@gnu-cfl-1 ld]$ gcc -fPIC -c y.c -Wa,-mx86-used-note=no [hjl@gnu-cfl-1 ld]$ ld -shared -o foo.so -Map libfoo.map y.o x.o [hjl@gnu-cfl-1 ld]$ readelf -n foo.so Displaying notes found in: .note.gnu.property Owner Data size Description GNU 0x00000000 NT_GNU_PROPERTY_TYPE_0 Properties: <corrupt GNU_PROPERTY_TYPE, size = 0> [hjl@gnu-cfl-1 ld]$
The fix has been posted at https://sourceware.org/ml/binutils/2019-06/msg00190.html
The master branch has been updated by H.J. Lu <hjl@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f93ab3a0b8039a1667a666f013cca50b03d67f9b commit f93ab3a0b8039a1667a666f013cca50b03d67f9b Author: H.J. Lu <hjl.tools@gmail.com> Date: Mon Jun 24 11:08:40 2019 -0700 elf: Remove the property after reporting its removal commit d2ef37ebd9f771d06edf1fdea37970f60b242b2d Author: H.J. Lu <hjl.tools@gmail.com> Date: Fri Dec 7 08:30:30 2018 -0800 elf: Report property change when merging properties failed to remove the property after reporting it has been removed. This patch corrects it. bfd/ PR ld/24721 * elf-properties.c (elf_merge_gnu_property_list): Remove the property after reporting property removal. ld/ PR ld/24721 * testsuite/ld-x86-64/x86-64.exp: Run PR ld/24721 tests. * testsuite/ld-x86-64/pr24721-x32.d: New file. * testsuite/ld-x86-64/pr24721.d: Likewise. * testsuite/ld-x86-64/pr24721.map: Likewise. * testsuite/ld-x86-64/pr24721a.s: Likewise. * testsuite/ld-x86-64/pr24721b.s: Likewise.
The binutils-2_32-branch branch has been updated by H.J. Lu <hjl@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=df010caac3b33b1d38b6d67024091854c3f77c77 commit df010caac3b33b1d38b6d67024091854c3f77c77 Author: H.J. Lu <hjl.tools@gmail.com> Date: Mon Jun 24 11:08:40 2019 -0700 elf: Remove the property after reporting its removal commit d2ef37ebd9f771d06edf1fdea37970f60b242b2d Author: H.J. Lu <hjl.tools@gmail.com> Date: Fri Dec 7 08:30:30 2018 -0800 elf: Report property change when merging properties failed to remove the property after reporting it has been removed. This patch corrects it. bfd/ PR ld/24721 * elf-properties.c (elf_merge_gnu_property_list): Remove the property after reporting property removal. ld/ PR ld/24721 * testsuite/ld-x86-64/x86-64.exp: Run PR ld/24721 tests. * testsuite/ld-x86-64/pr24721-x32.d: New file. * testsuite/ld-x86-64/pr24721.d: Likewise. * testsuite/ld-x86-64/pr24721.map: Likewise. * testsuite/ld-x86-64/pr24721a.s: Likewise. * testsuite/ld-x86-64/pr24721b.s: Likewise. (cherry picked from commit f93ab3a0b8039a1667a666f013cca50b03d67f9b)
Fixed for 2.33 and 2.32 branch.