[PATCH] sparc: Prevent all but undef weak syms from becoming dynamic.

Egeyar Bagcioglu egeyar.bagcioglu@oracle.com
Tue Jun 27 15:08:00 GMT 2017


On 06/07/2017 09:05 PM, Egeyar Bagcioglu wrote:
> On 06/06/2017 07:30 AM, jose.marchesi@oracle.com wrote:
>> Hi Egeyar.
>>
>>      Prevent sparc backend making symbols dynamic unless they are 
>> undefined
>>      weak. By doing so, stop dynamic linker confusing these symbols with
>>      library symbols.
>>
>> Your patch seems to fix all the currently failing tests of the LD
>> testsuite in sparc64:
>>
>> FAIL: Run indirect5 3
>> FAIL: Run indirect5 4
>> FAIL: Run indirect6 3
>> FAIL: Run indirect6 4
>> FAIL: indirect5c dynsym
>> FAIL: indirect5d dynsym
>> FAIL: indirect6c dynsym
>> FAIL: indirect6d dynsym
>> FAIL: Run pr2404 with PIE
>> FAIL: Run pr2404 with PIE (-z now)
>>
>> These all pass now.  Which is great! :)
>>
>> However, it also triggers a regression:
>>
>> gcc -B/home/jemarch/couts2/binutils-gdb/build/ld/tmpdir/ld/
>> -L/usr/local/sparc64-unknown-linux-gnu/lib64 \
>> -L/usr/local/lib64 -L/lib64 -L/usr/lib64
>> -L/usr/local/sparc64-unknown-linux-gnu/lib -L/usr/local/lib -L/lib\
>>   -L/usr/lib  -o tmpdir/ifunc-mainpn
>>   -L/home/jemarch/couts2/binutils-gdb/ld/testsuite/ld-ifunc -pie 
>> -Wl,-z,\
>>   now -Wl,--no-as-needed tmpdir/libifunc-libn.so tmpdir/ifunc-main.o
>>   Executing on host: sh -c {gcc
>>   -B/home/jemarch/couts2/binutils-gdb/build/ld/tmpdir/ld/
>>   -L/usr/local/sparc6\
>>   4-unknown-linux-gnu/lib64 -L/usr/local/lib64 -L/lib64 -L/usr/lib64
>>   -L/usr/local/sparc64-unknown-linux-gnu/l\
>>   ib -L/usr/local/lib -L/lib -L/usr/lib  -o tmpdir/ifunc-mainpn
>>   -L/home/jemarch/couts2/binutils-gdb/ld/tests\
>>   uite/ld-ifunc -pie -Wl,-z,now -Wl,--no-as-needed
>>   tmpdir/libifunc-libn.so tmpdir/ifunc-main.o 2>&1} /dev/nu\
>>   ll ld.tmp (timeout = 300)
>>   spawn [open ...]^M
>>   Running: tmpdir/ifunc-mainpn > tmpdir/ifunc-mainpn.out
>>   child killed: segmentation violation
>> FAIL: Run ifunc-main with PIE (-z now)
>>
>> Could you please take a look?
>> Thanks!
>
> Hi Jose,
>
> Thank you for the review and bringing the issue to my attention! I am 
> looking into it.
>
> Egeyar

The patch is updated and attached. It fixes ld's test cases that fail on 
sparc. No regressions are revealed by made check. Please take a look.
Thanks!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-sparc-Prevent-all-but-undef-weak-syms-from-becoming-.patch
Type: text/x-patch
Size: 5457 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20170627/f0b4a762/attachment.bin>


More information about the Binutils mailing list