This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [ld, testsuite] Relax the expectation pattern for several plugin-* tests
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jiong Wang <jiong dot wang at foss dot arm dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Mon, 13 Feb 2017 08:57:21 -0800
- Subject: Re: [ld, testsuite] Relax the expectation pattern for several plugin-* tests
- Authentication-results: sourceware.org; auth=none
- References: <20150205135440.GA27203@gmail.com> <20150207094240.GD14796@bubble.grove.modra.org> <CAMe9rOoC1KKOHtPT81fFAnU8sjHWO0BLjG2=XoGU=b1oiuR10g@mail.gmail.com> <CAMe9rOo_u9VL2KjczbppH7C8Kv-j6-EOvPrB12Vw65Ro_mg4+g@mail.gmail.com> <54E61565.2090008@arm.com> <CAMe9rOr+xobuKsKDK1fHJXZ0qCtVSjy6=jzFbiXBuceLwvu1YQ@mail.gmail.com> <CAMe9rOpsjqOKz4pi9k8sCn_ESUeEnFE0zF5EsF9-74TQ4h+zRA@mail.gmail.com> <355e66f1-d3f6-25e6-1f07-d60fdc7122cf@foss.arm.com>
On Mon, Feb 13, 2017 at 8:03 AM, Jiong Wang <jiong.wang@foss.arm.com> wrote:
>>>> hook called: all symbols read.
>>>> Input: /work/fsf-trunk-3/src/binutils-gdb/ld/testsuite/ld-plugin/func.c
>>>> (/work/fsf-trunk-3/src/binutils-gdb/ld/testsuite/ld-plugin/func.c)
>>>> Sym: 'func' Resolution: LDPR_PREVAILING_DEF
>>>> Sym: '_func' Resolution: LDPR_PREVAILING_DEF_IRONLY
>>>> /work/fsf-trunk-3/build-arm-none-eabi/obj/binutils/ld/ld-new:
>>>> /work/fsf-trunk-3/src/binutils-gdb/ld/testsuite/ld-plugin/func.c (symbol
>>>> from plugin)(func): warning: interworking not enabled.
>>>> first occurrence:
>>>> /work/fsf-trunk-3/build-arm-none-eabi/obj/binutils/ld/tmpdir/main.o:
>>>> Thumb
>>>> call to ARM
>>>
>>>
>>> I think those failures are caused by those extra messages.
>>> I am not familiar with ARM linker. I can skip those tests
>>> for ARM.
>>
>>
>> It looks like an ARM linker bug. ARM linker shouldn't complain
>> anything on input BFDs with BFD_PLUGIN since it is a dummy
>> input file.
>
>
> Or can we simply relax the testcase expectation result a little bit while
> we still keeps those essential outputs that we want to catch?
>
> Is this patch OK for master?
>
> IMHO, keeping the warning might be better than silently accepting it. As
> the
> dummy input file really doesn't have proper elf header flags. I am not sure
> if relax the checking on BFD_PLUGIN will cause hiding silent issue once
> there
> is future change on BFD_PLUGIN.
>
> ld/
> 2017-02-10 Jiong Wang <jiong.wang@arm.com>
>
> * testsuite/ld-plugin/plugin-15.d: Relax the match pattern.
> * testsuite/ld-plugin/plugin-16.d: Likewise.
> * testsuite/ld-plugin/plugin-20.d: Likewise.
> * testsuite/ld-plugin/plugin-21.d: Likewise.
> * testsuite/ld-plugin/plugin-22.d: Likewise.
> * testsuite/ld-plugin/plugin-23.d: Likewise.
>
I agree that ARM linker shouldn't complain IR symbols in this case.
Can you update ARM linker like this?
--
H.J.
--
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 8171b0b..c3d99df 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -2115,7 +2115,7 @@ typedef unsigned short int insn16;
#define INTERWORK_FLAG(abfd) \
(EF_ARM_EABI_VERSION (elf_elfheader (abfd)->e_flags) >= EF_ARM_EABI_VER4 \
|| (elf_elfheader (abfd)->e_flags & EF_ARM_INTERWORK) \
- || ((abfd)->flags & BFD_LINKER_CREATED))
+ || ((abfd)->flags & (BFD_LINKER_CREATED | BFD_PLUGIN)))
/* The linker script knows the section names for placement.
The entry_names are used to do simple name mangling on the stubs.