<div dir="ltr">I'm not ARM expert, but yes I guess so.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Oct 17, 2019 at 6:16 PM Tobias Hieta <<a href="mailto:tobias@plexapp.com">tobias@plexapp.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello Rui,<br>
<br>
Thanks for your reply. I tried with the keep-section argument and that<br>
made the shared library work.<br>
<br>
Should these sections be kept around by default maybe?<br>
<br>
-- Tobias<br>
<br>
On Thu, Oct 17, 2019 at 11:06 AM Rui Ueyama <<a href="mailto:ruiu@google.com" target="_blank">ruiu@google.com</a>> wrote:<br>
><br>
> One thing I noticed is that llvm-strip seemed to remove a .ARM.attributes section. Can you try --keep-section=.ARM.attributes to tell to the command to keep the section?<br>
><br>
> On Thu, Oct 17, 2019 at 5:37 PM Tobias Hieta via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
>><br>
>> Hello,<br>
>><br>
>> Recently we tried to streamline our toolchain by removing some GNU<br>
>> tools with LLVM tools to avoid having multiple copies of strip, nm, ar<br>
>> and similar tools. Today we ran into a really strange issue where<br>
>> shared objects where not loadable.<br>
>><br>
>> We where able to track this down to llvm-strip with default arguments<br>
>> creating a shared object that doesn't load correctly. It works if we<br>
>> switch from not passing args to llvm-strip to pass -strip-all-gnu<br>
>><br>
>> I built bzip2 and libbz2.so to show this case here:<br>
>> <a href="https://1drv.ms/u/s!Amjta5FRkBbbkiz14aHTRJe03LlL?e=2mGvTN" rel="noreferrer" target="_blank">https://1drv.ms/u/s!Amjta5FRkBbbkiz14aHTRJe03LlL?e=2mGvTN</a><br>
>><br>
>> This is the error we got by using the stripped shared object with<br>
>> llvm-strip -strip-all:<br>
>><br>
>> admin@Netgear-RN212:~/b$ LD_PRELOAD=./libbz2.so.all ./bzip2<br>
>> ERROR: ld.so: object './libbz2.so.all' from LD_PRELOAD cannot be<br>
>> preloaded (cannot open shared object file): ignored.<br>
>> ./bzip2: error while loading shared libraries: libbz2.so: cannot open<br>
>> shared object file: No such file or directory<br>
>><br>
>> And with strip-all-gnu it works:<br>
>> admin@Netgear-RN212:~/b$ LD_PRELOAD=./libbz2.so.all_gnu ./bzip2<br>
>> bzip2: I won't write compressed data to a terminal.<br>
>> bzip2: For help, type: `bzip2 --help'.<br>
>><br>
>> This only seems to happen on Linux-armv7hf - we haven't seen this on<br>
>> any of the intel platforms.<br>
>><br>
>> Thanks,<br>
>> Tobias<br>
>> _______________________________________________<br>
>> LLVM Developers mailing list<br>
>> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
>> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>