https://bugs.llvm.org/show_bug.cgi?id=45391

            Bug ID: 45391
           Summary: LTO ignores linker script symbol visibility
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: ELF
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]

Flutter is using the following linker script:

```
{
  global:
    JNI_OnLoad;
    _binary_icudtl_dat_start;
    _binary_icudtl_dat_size;
  local:
    *;
};
```

The intention is to avoid exposing any symbols except for the ones that are
explicitly listed. However, when enabling LTO, we see the following:

```
$ nm -gU out/android_release_arm64/libflutter.so 
0000000000299204 T JNI_OnLoad
00000000000aba10 R __clz_tab
0000000000290720 T __emutls_get_address
0000000000290878 T __emutls_register_common
00000000002908b4 T __udivti3
00000000000dc2b0 A _binary_icudtl_dat_size
000000000073cf00 D _binary_icudtl_dat_start
```

This issue only appeared after trying to update from LLVM 8 to 11 so it looks a
regression.

The reproducer is available at
https://storage.googleapis.com/fuchsia-build/lto-symbol-visibility-bug.tar.lzma
(note that the reproducer is 112M compressed due to the use of LTO).

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to