[PATCH] Set non_ir_ref_dynamic if a symbol is made dynamic
H.J. Lu
hjl.tools@gmail.com
Thu Mar 22 12:35:00 GMT 2018
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Run-PR-ld-22983-test-only-for-targets-with-shared-li.patch
Type: text/x-patch
Size: 855 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20180322/9b3cf987/attachment.bin>
More information about the Binutils
mailing list