[PATCH] D52317: Add support for dynamic libraries on Hexagon

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 27 13:55:51 PDT 2018


MaskRay added inline comments.


================
Comment at: test/ELF/hexagon-shared.s:5
+# RUN: ld.lld -shared %t2 -o %t3
+# RUN: ld.lld -shared %t %t3 -o %t4
+# RUN: llvm-objdump -d -j .plt %t4 | FileCheck %s
----------------
MaskRay wrote:
> This test may not be affected but some might (it happened in the past for a few times)
> 
> When a `t.so` is used to link `t`. `DT_SONAME` of `t.so` will end up in the `.dynstr` section of `t`. Its length may change the section size sometimes. FileCheck on `t` may get different results on some systems.
> 
> For intermediate `%t3` here, it'd be better to specify `-soname t3.so` to fix the length of its `DT_SONAME`.
> DT_SONAME of t.so will end up in the .dynstr section of t

Correction: `DT_SONAME` (if exists) or filename

https://github.com/llvm-mirror/lld/tree/master/ELF/Driver.cpp#L232

    // DSOs usually have DT_SONAME tags in their ELF headers, and the
    // sonames are used to identify DSOs. But if they are missing,
    // they are identified by filenames. We don't know whether the new
    // file has a DT_SONAME or not because we haven't parsed it yet.
    // Here, we set the default soname for the file because we might
    // need it later.
    //
    // If a file was specified by -lfoo, the directory part is not
    // significant, as a user did not specify it. This behavior is
    // compatible with GNU.

`%t` is a temporary filename including a directory name, it may be of varying lengths.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D52317





More information about the llvm-commits mailing list