[PATCH] [mips] Add the following MIPS options that control gp-relative addressing of small data items: -mgpopt, -mlocal-sdata, -mextern-sdata.

Sasa Stankovic Sasa.Stankovic at imgtec.com
Fri Oct 10 04:05:28 PDT 2014


================
Comment at: lib/Target/Mips/MipsTargetObjectFile.cpp:65
@@ -51,1 +64,3 @@
+  // definitions.
   if (GV->isDeclaration() || GV->hasAvailableExternallyLinkage())
+    return IsGlobalInSmallSectionImpl(GV, TM);
----------------
dsanders wrote:
> sstankovic wrote:
> > dsanders wrote:
> > > Are static globals allowed in the small section?
> > Do you mean globals defined in the same file? If so, they are.
> I mean globals defined in the same file that aren't available/visible to other objects.
They are allowed, just like the globals defined in the same file that are visible to other objects. This two cases are handled in .ll file by "internal" and "data" tests, respectively. The difference between them is that gp_rel for static globals can be disabled using -mlocal-sdata=0.

http://reviews.llvm.org/D4903






More information about the llvm-commits mailing list