[PATCH] D53782: [llvm-objcopy] Don't apply --localize flags to common symbols

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 1 02:32:44 PDT 2018


jhenderson added a comment.

In https://reviews.llvm.org/D53782#1282586, @rupprecht wrote:

> In https://reviews.llvm.org/D53782#1282384, @jhenderson wrote:
>
> > LGTM.
> >
> > I haven't even been able to get the assembler to emit a STT_COMMON symbol. What does the assembly and command-line look like?
>
>
> You need to pass in `--elf-stt-common=yes`, and AFAICT also need to be using GNU as (not sure if clang can produce STT_COMMON like this).


I tried, and I still ended up with an STT_OBJECT...! But it doesn't matter at this point.



================
Comment at: test/tools/llvm-objcopy/localize-hidden.test:9
   Data:            ELFDATA2LSB
-  Type:            ET_REL
+  Type:            ET_EXEC
   Machine:         EM_X86_64
----------------
You should change this back if we are reverting to the previous version.


================
Comment at: test/tools/llvm-objcopy/localize-hidden.test:126
 #CHECK-NEXT:  Symbol {
+#CHECK-NEXT:    Name: hiddenGlobalSttCommon
+#CHECK-NEXT:    Value: 0x2006
----------------
I'm not sure that STT_COMMON symbols should be tested if we're putting them in SHN_COMMON (they're no different from STT_OBJECT etc), as there shouldn't be a SHN_COMMON in a linked executable as far as I understand it.


Repository:
  rL LLVM

https://reviews.llvm.org/D53782





More information about the llvm-commits mailing list