[PATCH] D56920: [PPC64] Sort .toc sections accessed with small code model relocs close to the .got

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 20 23:29:34 PST 2019


grimar added a comment.

> ! In D56920#1364896 <https://reviews.llvm.org/D56920#1364896>, @MaskRay wrote:
>  Both ld.bfd and gold have the similar "small_toc_reloc" notation and `binutils-gdb/gold/power.cc` does similar TOC sorting (ld.bfd has a much more complicated rule).
>  https://sourceware.org/git/?p=binutils-gdb.git;a=blob;hb=dff021e14a9c72380311c15a90c1a646b179b987;f=gold/powerpc.cc#l8376

Thanks for the info!



================
Comment at: ELF/Writer.cpp:1254
 
+  if (Name == ".toc") {
+    // Perform custom sorting of .toc sections.
----------------
You should probably check for `Config->EMachine == EM_PPC64` here too as
`.toc` can be (in theory) a name of a regular section for other targets and would be simpler to do nothing at all in that case.


Repository:
  rLLD LLVM Linker

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

https://reviews.llvm.org/D56920





More information about the llvm-commits mailing list