From 9267588cdcaddad64078201dcbd3ea4a761c35d7 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 5 Apr 2007 16:16:28 +0000 Subject: [PATCH] bfd/ 2007-04-05 H.J. Lu PR ld/4304 * elflink.c (bfd_elf_final_link): Call einfo callback in bfd_link_info instead of _bfd_error_handler for DT_TEXTREL warning. ld/testsuite/ 2007-04-05 H.J. Lu PR ld/4304 * ld-i386/i386.exp: Run "warn1". * ld-i386/warn1.d: New file. * ld-i386/warn1.s: Likewise. --- bfd/ChangeLog | 7 +++++++ bfd/elflink.c | 4 ++-- ld/testsuite/ChangeLog | 8 ++++++++ ld/testsuite/ld-i386/i386.exp | 1 + ld/testsuite/ld-i386/warn1.d | 4 ++++ ld/testsuite/ld-i386/warn1.s | 5 +++++ 6 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 ld/testsuite/ld-i386/warn1.d create mode 100644 ld/testsuite/ld-i386/warn1.s diff --git a/bfd/ChangeLog b/bfd/ChangeLog index ab00026624a..813c13dcaae 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2007-04-05 H.J. Lu + + PR ld/4304 + * elflink.c (bfd_elf_final_link): Call einfo callback in + bfd_link_info instead of _bfd_error_handler for DT_TEXTREL + warning. + 2007-04-05 Alan Modra * elf32-spu.c (spu_elf_output_symbol_hook): New function. diff --git a/bfd/elflink.c b/bfd/elflink.c index 360ac69cdcb..228debb3a6e 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -9944,8 +9944,8 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) if (dyn.d_tag == DT_TEXTREL) { - _bfd_error_handler - (_("warning: creating a DT_TEXTREL in a shared object.")); + info->callbacks->einfo + (_("%P: warning: creating a DT_TEXTREL in a shared object.\n")); break; } } diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index d15e7974e27..bea757ea21c 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2007-04-05 H.J. Lu + + PR ld/4304 + * ld-i386/i386.exp: Run "warn1". + + * ld-i386/warn1.d: New file. + * ld-i386/warn1.s: Likewise. + 2007-04-05 H.J. Lu * ld-i386/combreloc.d: Remove #target: i?86-*-*. diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp index f0088293826..1032e8ec3c5 100644 --- a/ld/testsuite/ld-i386/i386.exp +++ b/ld/testsuite/ld-i386/i386.exp @@ -115,3 +115,4 @@ run_dump_test "pcrel8" run_dump_test "pcrel16" run_dump_test "pcrel16abs" run_dump_test "alloc" +run_dump_test "warn1" diff --git a/ld/testsuite/ld-i386/warn1.d b/ld/testsuite/ld-i386/warn1.d new file mode 100644 index 00000000000..dd541f25df9 --- /dev/null +++ b/ld/testsuite/ld-i386/warn1.d @@ -0,0 +1,4 @@ +#name: --warn-shared-textrel --fatal-warnings +#as: --32 +#ld: -shared -melf_i386 --warn-shared-textrel --fatal-warnings +#error: .*warning: creating a DT_TEXTREL in a shared object. diff --git a/ld/testsuite/ld-i386/warn1.s b/ld/testsuite/ld-i386/warn1.s new file mode 100644 index 00000000000..ca3481a48fb --- /dev/null +++ b/ld/testsuite/ld-i386/warn1.s @@ -0,0 +1,5 @@ + .text + .globl foo + .type foo, @function +foo: + movl bar, %eax -- 2.30.2