[PATCH] Linking of shared libraries for MIPS little-endian 32-bit target

Shankar Kalpathi Easwaran shankarke at gmail.com
Wed Nov 20 08:46:55 PST 2013



================
Comment at: lib/ReaderWriter/ELF/DefaultTargetHandler.h:62-78
@@ -61,1 +61,19 @@
+
+  /// \brief create dynamic table
+  LLD_UNIQUE_BUMP_PTR(DynamicTable<ELFT>)
+  createDynamicTable(llvm::BumpPtrAllocator &alloc,
+                     StringRef name, int32_t order) {
+    return LLD_UNIQUE_BUMP_PTR(DynamicTable<ELFT>)(
+        new (alloc) DynamicTable<ELFT>(TargetHandler<ELFT>::_context,
+                                       name, order));
+  }
+
+  /// \brief create dynamic symbol table
+  LLD_UNIQUE_BUMP_PTR(DynamicSymbolTable<ELFT>)
+  createDynamicSymbolTable(llvm::BumpPtrAllocator &alloc,
+                           StringRef name, int32_t order) {
+    return LLD_UNIQUE_BUMP_PTR(DynamicSymbolTable<ELFT>)(
+        new (alloc) DynamicSymbolTable<ELFT>(TargetHandler<ELFT>::_context,
+                                             name, order));
+  }
 };
----------------
Simon Atanasyan wrote:
> Shankar Kalpathi Easwaran wrote:
> > remove all parameters to this function. alloc should be owned by the TargetHandler for Mips. name/order could be completely decided by Mips too.
> Just want to be sure that I understand you properly. Do you suggest to delete default implementations of `createDynamicTable()` and `createDynamicSymbolTable()` from the `DefaultTargetHandler` and define these functions as well as allocator in each target handlers for each supported targets (x86, x86_64, hexagon, mips etc)?
createDynamicTable would just return DynamicTable<ELFT> section.

If the targets override that functionality they could return a DynamicTable<ELFT> section. All the required parameters needed for creating the Target specific DynamicTable section is present in the TargetHandler.


http://llvm-reviews.chandlerc.com/D2156



More information about the llvm-commits mailing list