[PATCH] D56586: [PPC64] Update LocalEntry from assigned symbols

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 10 17:41:48 PDT 2019


MaskRay accepted this revision.
MaskRay added a comment.
This revision is now accepted and ready to land.

I've checked the behavior is consistent with GNU as. It has a final pass over the symbol table to copy symbol attributes. The call stack:

gas/write.c write_object_file
gas/config/obj-elf.c elf_copy_symbol_attributes
gas/symbols.c resolve_symbol_value "Resolve the value of a symbol.  This is called during the final pass over the symbol table to resolve any symbols with complex values."

  values.gas/symbols.c copy_symbol_attributes

What copy_symbol_attributes does:

  S_SET_OTHER (dest, (ELF_ST_VISIBILITY (S_GET_OTHER (dest))
          | (S_GET_OTHER (src) & ~ELF_ST_VISIBILITY (-1))));

While it copies all non-visibility bits (0-1), MCSymbolELF::setOther copies just the 3 most significant bits (5-7). Bits 2-4 are not copied but they are not used anyway.

Consider adding the test to test/MC/PowerPC/ppc64-localentry-symver.s instead. You may add another sets of `bar` `bar at FBSD_.1` `__impl_bar`, and move `.set __impl_bar, bar` before `.localentry bar, 8`. llvm-objdump can print non-visibility `st_other` bits now.



================
Comment at: llvm/test/MC/AsmParser/PPC64/lit.local.cfg:1
+if 'PowerPC' in config.root.targets:
+    config.unsupported = False
----------------
Delete this file.


================
Comment at: llvm/test/MC/AsmParser/PPC64/ppc64-localentry.s:1
+# RUN: llvm-mc -triple powerpc64-unknown-unknown -filetype=obj %s -o %t
+# RUN: llvm-objdump -s -j .symtab %t | FileCheck %s
----------------
Delete this file.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56586/new/

https://reviews.llvm.org/D56586





More information about the llvm-commits mailing list