From 25d17eb4ccec7e63aa8d5fbe03202df8c82e1619 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 15 Jul 2010 00:42:23 +0000 Subject: [PATCH] Add testcases for PR ld/11817. 2010-07-14 H.J. Lu PR ld/11817 * ld-i386/compressed1.s: New. * ld-i386/compressed1.d: Likewise. * ld-x86-64/compressed1.s: Likewise. * ld-x86-64/compressed1.d: Likewise. * ld-i386/i386.exp: Run compressed1. * ld-x86-64/x86-64.exp: Likewise. --- ld/testsuite/ChangeLog | 11 +++ ld/testsuite/ld-i386/compressed1.d | 9 ++ ld/testsuite/ld-i386/compressed1.s | 186 +++++++++++++++++++++++++++++++++++ ld/testsuite/ld-i386/i386.exp | 7 ++ ld/testsuite/ld-x86-64/compressed1.d | 9 ++ ld/testsuite/ld-x86-64/compressed1.s | 176 +++++++++++++++++++++++++++++++++ ld/testsuite/ld-x86-64/x86-64.exp | 6 ++ 7 files changed, 404 insertions(+) create mode 100644 ld/testsuite/ld-i386/compressed1.d create mode 100644 ld/testsuite/ld-i386/compressed1.s create mode 100644 ld/testsuite/ld-x86-64/compressed1.d create mode 100644 ld/testsuite/ld-x86-64/compressed1.s diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 71ce0e6..fc42eeb 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,14 @@ +2010-07-14 H.J. Lu + + PR ld/11817 + * ld-i386/compressed1.s: New. + * ld-i386/compressed1.d: Likewise. + * ld-x86-64/compressed1.s: Likewise. + * ld-x86-64/compressed1.d: Likewise. + + * ld-i386/i386.exp: Run compressed1. + * ld-x86-64/x86-64.exp: Likewise. + 2010-07-13 H.J. Lu PR ld/11812 diff --git a/ld/testsuite/ld-i386/compressed1.d b/ld/testsuite/ld-i386/compressed1.d new file mode 100644 index 0000000..3a57c81 --- /dev/null +++ b/ld/testsuite/ld-i386/compressed1.d @@ -0,0 +1,9 @@ +#name: undefined symbol with compressed debug sections +#as: --32 +#ld: -e foo -melf_i386 --noinhibit-exec +#warning: .*/compressed1.c:13: undefined reference to .bar. +#nm: -n + +#... +[ \t]+U bar +#pass diff --git a/ld/testsuite/ld-i386/compressed1.s b/ld/testsuite/ld-i386/compressed1.s new file mode 100644 index 0000000..9d58d0b --- /dev/null +++ b/ld/testsuite/ld-i386/compressed1.s @@ -0,0 +1,186 @@ + .file "compressed1.c" + .section .debug_abbrev,"",@progbits +.Ldebug_abbrev0: + .section .debug_info,"",@progbits +.Ldebug_info0: + .section .debug_line,"",@progbits +.Ldebug_line0: + .text +.Ltext0: + .cfi_sections .debug_frame + .p2align 4,,15 +.globl foo + .type foo, @function +foo: +.LFB0: + .file 1 "compressed1.c" + .loc 1 12 0 + .cfi_startproc + pushl %ebp + .cfi_def_cfa_offset 8 + movl %esp, %ebp + .cfi_offset 5, -8 + .cfi_def_cfa_register 5 + subl $8, %esp + .loc 1 14 0 + leave + .cfi_restore 5 + .cfi_def_cfa 4, 4 + .loc 1 13 0 + jmp bar + .cfi_endproc +.LFE0: + .size foo, .-foo +.Letext0: + .section .debug_info + .long 0x5e + .value 0x3 + .long .Ldebug_abbrev0 + .byte 0x4 + .uleb128 0x1 + .long .LASF5 + .byte 0x1 + .long .LASF6 + .long .LASF7 + .long .Ltext0 + .long .Letext0 + .long .Ldebug_line0 + .uleb128 0x2 + .byte 0x1 + .byte 0x6 + .long .LASF0 + .uleb128 0x2 + .byte 0x2 + .byte 0x5 + .long .LASF1 + .uleb128 0x3 + .byte 0x4 + .byte 0x5 + .string "int" + .uleb128 0x2 + .byte 0x4 + .byte 0x5 + .long .LASF2 + .uleb128 0x2 + .byte 0x1 + .byte 0x8 + .long .LASF3 + .uleb128 0x2 + .byte 0x2 + .byte 0x7 + .long .LASF4 + .uleb128 0x4 + .byte 0x1 + .string "foo" + .byte 0x1 + .byte 0xb + .long .LFB0 + .long .LFE0 + .byte 0x1 + .byte 0x9c + .byte 0x0 + .section .debug_abbrev + .uleb128 0x1 + .uleb128 0x11 + .byte 0x1 + .uleb128 0x25 + .uleb128 0xe + .uleb128 0x13 + .uleb128 0xb + .uleb128 0x3 + .uleb128 0xe + .uleb128 0x1b + .uleb128 0xe + .uleb128 0x11 + .uleb128 0x1 + .uleb128 0x12 + .uleb128 0x1 + .uleb128 0x10 + .uleb128 0x6 + .byte 0x0 + .byte 0x0 + .uleb128 0x2 + .uleb128 0x24 + .byte 0x0 + .uleb128 0xb + .uleb128 0xb + .uleb128 0x3e + .uleb128 0xb + .uleb128 0x3 + .uleb128 0xe + .byte 0x0 + .byte 0x0 + .uleb128 0x3 + .uleb128 0x24 + .byte 0x0 + .uleb128 0xb + .uleb128 0xb + .uleb128 0x3e + .uleb128 0xb + .uleb128 0x3 + .uleb128 0x8 + .byte 0x0 + .byte 0x0 + .uleb128 0x4 + .uleb128 0x2e + .byte 0x0 + .uleb128 0x3f + .uleb128 0xc + .uleb128 0x3 + .uleb128 0x8 + .uleb128 0x3a + .uleb128 0xb + .uleb128 0x3b + .uleb128 0xb + .uleb128 0x11 + .uleb128 0x1 + .uleb128 0x12 + .uleb128 0x1 + .uleb128 0x40 + .uleb128 0xa + .byte 0x0 + .byte 0x0 + .byte 0x0 + .section .debug_pubnames,"",@progbits + .long 0x16 + .value 0x2 + .long .Ldebug_info0 + .long 0x62 + .long 0x4f + .string "foo" + .long 0x0 + .section .debug_pubtypes,"",@progbits + .long 0xe + .value 0x2 + .long .Ldebug_info0 + .long 0x62 + .long 0x0 + .section .debug_aranges,"",@progbits + .long 0x1c + .value 0x2 + .long .Ldebug_info0 + .byte 0x4 + .byte 0x0 + .value 0x0 + .value 0x0 + .long .Ltext0 + .long .Letext0-.Ltext0 + .long 0x0 + .long 0x0 + .section .debug_str,"MS",@progbits,1 +.LASF0: + .string "signed char" +.LASF1: + .string "short int" +.LASF6: + .string "compressed1.c" +.LASF5: + .string "GNU C 4.4.4 20100630 (Red Hat 4.4.4-10)" +.LASF7: + .string "." +.LASF3: + .string "unsigned char" +.LASF2: + .string "long int" +.LASF4: + .string "short unsigned int" diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp index 3f20533..850713a 100644 --- a/ld/testsuite/ld-i386/i386.exp +++ b/ld/testsuite/ld-i386/i386.exp @@ -190,3 +190,10 @@ run_dump_test "protected2" run_dump_test "protected3" run_dump_test "tlspie1" run_dump_test "nogot1" + +if { !([istarget "i?86-*-linux*"] + || [istarget "x86_64-*-linux*"]) } { + return +} + +run_dump_test "compressed1" diff --git a/ld/testsuite/ld-x86-64/compressed1.d b/ld/testsuite/ld-x86-64/compressed1.d new file mode 100644 index 0000000..1dd0f4c --- /dev/null +++ b/ld/testsuite/ld-x86-64/compressed1.d @@ -0,0 +1,9 @@ +#name: undefined symbol with compressed debug sections +#as: --64 +#ld: -e foo -melf_x86_64 --noinhibit-exec +#warning: .*/compressed1.c:13: undefined reference to .bar. +#nm: -n + +#... +[ \t]+U bar +#pass diff --git a/ld/testsuite/ld-x86-64/compressed1.s b/ld/testsuite/ld-x86-64/compressed1.s new file mode 100644 index 0000000..196bc88 --- /dev/null +++ b/ld/testsuite/ld-x86-64/compressed1.s @@ -0,0 +1,176 @@ + .file "compressed1.c" + .section .debug_abbrev,"",@progbits +.Ldebug_abbrev0: + .section .debug_info,"",@progbits +.Ldebug_info0: + .section .debug_line,"",@progbits +.Ldebug_line0: + .text +.Ltext0: + .cfi_sections .debug_frame + .p2align 4,,15 +.globl foo + .type foo, @function +foo: +.LFB0: + .file 1 "compressed1.c" + .loc 1 12 0 + .cfi_startproc + .loc 1 13 0 + jmp bar + .cfi_endproc +.LFE0: + .size foo, .-foo +.Letext0: + .section .debug_info + .long 0x6e + .value 0x3 + .long .Ldebug_abbrev0 + .byte 0x8 + .uleb128 0x1 + .long .LASF5 + .byte 0x1 + .long .LASF6 + .long .LASF7 + .quad .Ltext0 + .quad .Letext0 + .long .Ldebug_line0 + .uleb128 0x2 + .byte 0x1 + .byte 0x6 + .long .LASF0 + .uleb128 0x2 + .byte 0x2 + .byte 0x5 + .long .LASF1 + .uleb128 0x3 + .byte 0x4 + .byte 0x5 + .string "int" + .uleb128 0x2 + .byte 0x8 + .byte 0x5 + .long .LASF2 + .uleb128 0x2 + .byte 0x1 + .byte 0x8 + .long .LASF3 + .uleb128 0x2 + .byte 0x2 + .byte 0x7 + .long .LASF4 + .uleb128 0x4 + .byte 0x1 + .string "foo" + .byte 0x1 + .byte 0xb + .quad .LFB0 + .quad .LFE0 + .byte 0x1 + .byte 0x9c + .byte 0x0 + .section .debug_abbrev + .uleb128 0x1 + .uleb128 0x11 + .byte 0x1 + .uleb128 0x25 + .uleb128 0xe + .uleb128 0x13 + .uleb128 0xb + .uleb128 0x3 + .uleb128 0xe + .uleb128 0x1b + .uleb128 0xe + .uleb128 0x11 + .uleb128 0x1 + .uleb128 0x12 + .uleb128 0x1 + .uleb128 0x10 + .uleb128 0x6 + .byte 0x0 + .byte 0x0 + .uleb128 0x2 + .uleb128 0x24 + .byte 0x0 + .uleb128 0xb + .uleb128 0xb + .uleb128 0x3e + .uleb128 0xb + .uleb128 0x3 + .uleb128 0xe + .byte 0x0 + .byte 0x0 + .uleb128 0x3 + .uleb128 0x24 + .byte 0x0 + .uleb128 0xb + .uleb128 0xb + .uleb128 0x3e + .uleb128 0xb + .uleb128 0x3 + .uleb128 0x8 + .byte 0x0 + .byte 0x0 + .uleb128 0x4 + .uleb128 0x2e + .byte 0x0 + .uleb128 0x3f + .uleb128 0xc + .uleb128 0x3 + .uleb128 0x8 + .uleb128 0x3a + .uleb128 0xb + .uleb128 0x3b + .uleb128 0xb + .uleb128 0x11 + .uleb128 0x1 + .uleb128 0x12 + .uleb128 0x1 + .uleb128 0x40 + .uleb128 0xa + .byte 0x0 + .byte 0x0 + .byte 0x0 + .section .debug_pubnames,"",@progbits + .long 0x16 + .value 0x2 + .long .Ldebug_info0 + .long 0x72 + .long 0x57 + .string "foo" + .long 0x0 + .section .debug_pubtypes,"",@progbits + .long 0xe + .value 0x2 + .long .Ldebug_info0 + .long 0x72 + .long 0x0 + .section .debug_aranges,"",@progbits + .long 0x2c + .value 0x2 + .long .Ldebug_info0 + .byte 0x8 + .byte 0x0 + .value 0x0 + .value 0x0 + .quad .Ltext0 + .quad .Letext0-.Ltext0 + .quad 0x0 + .quad 0x0 + .section .debug_str,"MS",@progbits,1 +.LASF0: + .string "signed char" +.LASF1: + .string "short int" +.LASF6: + .string "compressed1.c" +.LASF5: + .string "GNU C 4.4.4" +.LASF7: + .string "." +.LASF3: + .string "unsigned char" +.LASF2: + .string "long int" +.LASF4: + .string "short unsigned int" diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp index 76ac474..d7ca525 100644 --- a/ld/testsuite/ld-x86-64/x86-64.exp +++ b/ld/testsuite/ld-x86-64/x86-64.exp @@ -99,3 +99,9 @@ run_dump_test "tlsle1" run_dump_test "tlspie1" run_dump_test "unique1" run_dump_test "nogot1" + +if { ![istarget "x86_64-*-linux*"] } { + return +} + +run_dump_test "compressed1" -- 2.7.4