This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Set non_ir_ref_dynamic if a symbol is made dynamic


On Thu, Mar 22, 2018 at 4:40 AM, Bin.Cheng <amker.cheng@gmail.com> wrote:
> On Tue, Mar 20, 2018 at 4:20 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Tue, Mar 20, 2018 at 9:09 AM, Christophe Lyon
>> <christophe.lyon@linaro.org> wrote:
>>> On 20 March 2018 at 16:39, H.J. Lu <hjl.tools@gmail.com> wrote:
>>>> On Tue, Mar 20, 2018 at 8:00 AM, Christophe Lyon
>>>> <christophe.lyon@linaro.org> wrote:
>>>>> On 20 March 2018 at 14:11, H.J. Lu <hjl.tools@gmail.com> wrote:
>>>>>> On Tue, Mar 20, 2018 at 6:08 AM, Christophe Lyon
>>>>>> <christophe.lyon@linaro.org> wrote:
>>>>>>> On 20 March 2018 at 14:01, H.J. Lu <hjl.tools@gmail.com> wrote:
>>>>>>>> On Tue, Mar 20, 2018 at 5:54 AM, Christophe Lyon
>>>>>>>> <christophe.lyon@linaro.org> wrote:
>>>>>>>>> On 20 March 2018 at 12:00, Nick Clifton <nickc@redhat.com> wrote:
>>>>>>>>>> Hi H.J.
>>>>>>>>>>
>>>>>>>>>>> Checked into master.   Nick, is this OK to backport to 2.30 branch?
>>>>>>>>>>
>>>>>>>>>> Yes - please go ahead and check it in.
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> Since this was checked-in in master, I've noticed
>>>>>>>>> FAIL:Build pr22983
>>>>>>>>> on native ARM targets.
>>>>>>>>> It passes on AArch64 though.
>>>>>>>>>
>>>>>>>>> Can you check/fix?
>>>>>>>>>
>>>>>>>>
>>>>>>>> I don't have arm machine.  Please show the ld log.
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> Sure, I can see:
>>>>>>>
>>>>>>> regexp_diff match failure
>>>>>>> regexp "^ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +FUNC +GLOBAL +DEFAULT
>>>>>>> +[0-9]+ +func_attr_used_disabled$"
>>>>>>> line   "     6: 00000000     0 FUNC    GLOBAL DEFAULT  UND abort@GLIBC_2.4 (2)"
>>>>>>> FAIL: Build pr22983
>>>>>>
>>>>>> Please show "readelf --dyn-syms --wide tmpdir/pr22983"
>>>>>>
>>>>>
>>>>> Sorry for the delay, as it was an automated build, I needed a bit of
>>>>> time to reproduce it manually:
>>>>> Symbol table '.dynsym' contains 9 entries:
>>>>>    Num:    Value  Size Type    Bind   Vis      Ndx Name
>>>>>      0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND
>>>>>      1: 00000000     0 NOTYPE  WEAK   DEFAULT  UND __gmon_start__
>>>>>      2: 0002102c     4 OBJECT  GLOBAL DEFAULT   23 var_attr_used_enabled
>>>>>      3: 00021028     4 OBJECT  GLOBAL DEFAULT   23 var_attr_used_disabled
>>>>>      4: 00000000     0 FUNC    GLOBAL DEFAULT  UND __printf_chk@GLIBC_2.4 (2)
>>>>>      5: 000104f5     4 FUNC    GLOBAL DEFAULT   13 func_attr_used_enabled
>>>>>      6: 00000000     0 FUNC    GLOBAL DEFAULT  UND abort@GLIBC_2.4 (2)
>>>>>      7: 00000000     0 FUNC    GLOBAL DEFAULT  UND
>>>>> __libc_start_main@GLIBC_2.4 (2)
>>>>>      8: 000104f9     4 FUNC    GLOBAL DEFAULT   13 func_attr_used_disabled
>>>>>
>>>>>
>>>>> So the problem is that func_attr_used_enabled and
>>>>> func_attr_used_disabled do not appear next to each other.
>>>>>
>>>>> This does the trick:
>>>>> diff --git a/ld/testsuite/ld-plugin/pr22983.d b/ld/testsuite/ld-plugin/pr22983.d
>>>>> index af1d710..d75a26b 100644
>>>>> --- a/ld/testsuite/ld-plugin/pr22983.d
>>>>> +++ b/ld/testsuite/ld-plugin/pr22983.d
>>>>> @@ -5,5 +5,6 @@ Symbol table '\.dynsym' contains [0-9]+ entries:
>>>>>   +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +OBJECT +GLOBAL +DEFAULT +[0-9]+
>>>>> +var_attr_used_disabled
>>>>>  #...
>>>>>   +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +FUNC +GLOBAL +DEFAULT +[0-9]+
>>>>> +func_attr_used_enabled
>>>>> +#...
>>>>>   +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +FUNC +GLOBAL +DEFAULT +[0-9]+
>>>>> +func_attr_used_disabled
>>>>>  #...
>>>>>
>>>>
>>>> Please try this.
>>>>
>>> It works for me, thanks
>>>
>>
>> I am checking it into master branch and will backport it to 2.30 branch later.
> Hi,
> Should this test be skipped for bare-metal tools?  I can still see
> failures like:
>
> /.../obj/binutils/ld/../binutils/readelf --dyn-syms --wide
> tmpdir/pr22983 > dump.out
> extra regexps in /.../binutils-gdb/ld/testsuite/ld-plugin/pr22983.d
> starting with "^Symbol table '\.dynsym' contains [0-9]+ entries:$"
> FAIL: Build pr22983
>
> "readelf --dyn-syms --wide tmpdir/pr22983" gives nothing because it
> doesn't have .dynsym section?
>

Please try this.


-- 
H.J.
From 4a848b465d25ab09b586d43bbfc380e5702adcf5 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Thu, 22 Mar 2018 05:30:57 -0700
Subject: [PATCH] Run PR ld/22983 test only for targets with shared libraries

	* testsuite/ld-plugin/lto.exp: Run PR ld/22983 test only for
	targets with shared libraries.
---
 ld/testsuite/ld-plugin/lto.exp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
index 19aec3f7f2..6353789999 100644
--- a/ld/testsuite/ld-plugin/lto.exp
+++ b/ld/testsuite/ld-plugin/lto.exp
@@ -573,6 +573,9 @@ run_ld_link_exec_tests $lto_run_tests
 
 if { [is_elf_format] } {
     run_ld_link_exec_tests $lto_run_elf_tests
+}
+
+if { [is_elf_format] && [check_shared_lib_support] } {
     run_cc_link_tests [list \
 	[list \
 	    "Build pr22983" \
-- 
2.14.3


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]