diff -rupN --no-dereference binutils-2.32/bfd/elf-properties.c binutils-2.32-new/bfd/elf-properties.c --- binutils-2.32/bfd/elf-properties.c 2019-01-19 17:01:32.000000000 +0100 +++ binutils-2.32-new/bfd/elf-properties.c 2019-11-19 20:47:13.003654121 +0100 @@ -322,12 +322,10 @@ elf_merge_gnu_property_list (struct bfd_ (bfd_vma) p->property.pr_type, first_pbfd, abfd); } } - else - { - /* Remove this property. */ - *lastp = p->next; - continue; - } + + /* Remove this property. */ + *lastp = p->next; + continue; } else if (number_p) { diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-x86-64/pr24721a.s binutils-2.32-new/ld/testsuite/ld-x86-64/pr24721a.s --- binutils-2.32/ld/testsuite/ld-x86-64/pr24721a.s 1970-01-01 01:00:00.000000000 +0100 +++ binutils-2.32-new/ld/testsuite/ld-x86-64/pr24721a.s 2019-11-19 20:47:13.004654127 +0100 @@ -0,0 +1,34 @@ + .text + .globl foo + .type foo,@function + .p2align 4 +foo: + ret + + .section ".note.gnu.property", "a" +.ifdef __64_bit__ + .p2align 3 +.else + .p2align 2 +.endif + .long 1f - 0f /* name length */ + .long 5f - 2f /* data length */ + .long 5 /* note type */ +0: .asciz "GNU" /* vendor name */ +1: +.ifdef __64_bit__ + .p2align 3 +.else + .p2align 2 +.endif +2: .long 0xc0000002 /* pr_type. */ + .long 4f - 3f /* pr_datasz. */ +3: + .long 0x1 +4: +.ifdef __64_bit__ + .p2align 3 +.else + .p2align 2 +.endif +5: diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-x86-64/pr24721b.s binutils-2.32-new/ld/testsuite/ld-x86-64/pr24721b.s --- binutils-2.32/ld/testsuite/ld-x86-64/pr24721b.s 1970-01-01 01:00:00.000000000 +0100 +++ binutils-2.32-new/ld/testsuite/ld-x86-64/pr24721b.s 2019-11-19 20:47:13.004654127 +0100 @@ -0,0 +1,6 @@ + .text + .globl bar + .type bar,@function + .p2align 4 +bar: + ret diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-x86-64/pr24721.d binutils-2.32-new/ld/testsuite/ld-x86-64/pr24721.d --- binutils-2.32/ld/testsuite/ld-x86-64/pr24721.d 1970-01-01 01:00:00.000000000 +0100 +++ binutils-2.32-new/ld/testsuite/ld-x86-64/pr24721.d 2019-11-19 20:47:13.004654127 +0100 @@ -0,0 +1,6 @@ +#source: pr24721a.s +#source: pr24721b.s +#as: --64 -defsym __64_bit__=1 -mx86-used-note=no +#ld: -r -melf_x86_64 -Map tmpdir/pr24721.map +#readelf: -n +#map: pr24721.map diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-x86-64/pr24721.map binutils-2.32-new/ld/testsuite/ld-x86-64/pr24721.map --- binutils-2.32/ld/testsuite/ld-x86-64/pr24721.map 1970-01-01 01:00:00.000000000 +0100 +++ binutils-2.32-new/ld/testsuite/ld-x86-64/pr24721.map 2019-11-19 20:47:13.004654127 +0100 @@ -0,0 +1,3 @@ +#... +Removed property 0xc0000002 to merge tmpdir/pr24721a.o \(0x1\) and tmpdir/pr24721b.o \(not found\) +#pass diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-x86-64/pr24721-x32.d binutils-2.32-new/ld/testsuite/ld-x86-64/pr24721-x32.d --- binutils-2.32/ld/testsuite/ld-x86-64/pr24721-x32.d 1970-01-01 01:00:00.000000000 +0100 +++ binutils-2.32-new/ld/testsuite/ld-x86-64/pr24721-x32.d 2019-11-19 20:47:13.003654121 +0100 @@ -0,0 +1,6 @@ +#source: pr24721a.s +#source: pr24721b.s +#as: --x32 -mx86-used-note=no +#ld: -r -m elf32_x86_64 -Map tmpdir/pr24721.map +#readelf: -n +#map: pr24721.map diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-x86-64/x86-64.exp binutils-2.32-new/ld/testsuite/ld-x86-64/x86-64.exp --- binutils-2.32/ld/testsuite/ld-x86-64/x86-64.exp 2019-11-19 20:47:04.837607078 +0100 +++ binutils-2.32-new/ld/testsuite/ld-x86-64/x86-64.exp 2019-11-19 20:47:13.004654127 +0100 @@ -424,6 +424,8 @@ run_dump_test "pr23486d-x32" run_dump_test "pr23854" run_dump_test "pr23930" run_dump_test "pr23930-x32" +run_dump_test "pr24721" +run_dump_test "pr24721-x32" if { ![istarget "x86_64-*-linux*"] && ![istarget "x86_64-*-nacl*"]} { return