https://sourceware.org/bugzilla/show_bug.cgi?id=21626

            Bug ID: 21626
           Summary: Segmentation fault in
                    _bfd_elf_link_setup_gnu_properties
           Product: binutils
           Version: 2.29 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: hjl.tools at gmail dot com
  Target Milestone: ---

[hjl@gnu-6 property-5]$ cat x.s 
        .text
        .globl _start
_start:
        call foo
        ret

        .section ".note.gnu.property", "a"
.ifdef __64_bit__
        .p2align 3
.else
        .p2align 2
.endif
        .long 1f - 0f           /* name length.  */
        .long 3f - 1f           /* data length.  */
        /* NT_GNU_PROPERTY_TYPE_0 */
        .long 5                 /* note type.  */
0:
        .asciz "GNU"            /* vendor name.  */
1:
.ifdef __64_bit__
        .p2align 3
.else
        .p2align 2
.endif
        /* GNU_PROPERTY_X86_ISA_1_USED */
        .long 0xc0000000        /* pr_type.  */
        .long 5f - 4f           /* pr_datasz.  */
4:
        .long 0x0
5:
.ifdef __64_bit__
        .p2align 3
.else
        .p2align 2
.endif
3:
[hjl@gnu-6 property-5]$ cat y.s 
        .text
        .global foo
foo:
        ret

        .section ".note.gnu.property", "a"
.ifdef __64_bit__
        .p2align 3
.else
        .p2align 2
.endif
        .long 1f - 0f           /* name length.  */
        .long 3f - 1f           /* data length.  */
        /* NT_GNU_PROPERTY_TYPE_0 */
        .long 5                 /* note type.  */
0:
        .asciz "GNU"            /* vendor name.  */
1:
.ifdef __64_bit__
        .p2align 3
.else
        .p2align 2
.endif
        /* GNU_PROPERTY_X86_ISA_1_USED */
        .long 0xc0000000        /* pr_type.  */
        .long 5f - 4f           /* pr_datasz.  */
4:
        .long 0x0
5:
.ifdef __64_bit__
        .p2align 3
.else
        .p2align 2
.endif
3:
[hjl@gnu-6 property-5]$ make
as --64 -defsym __64_bit__=1  -o y.o y.s
./ld  -shared -o y.so y.o
as --64 -defsym __64_bit__=1  -o x.o x.s
./ld   -o x y.so x.o
Makefile:23: recipe for target 'x' failed
make: *** [x] Segmentation fault
make: *** Deleting file 'x'
[hjl@gnu-6 property-5]$

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to