[PATCH] handle global strings in merge string sections

Shankar Kalpathi Easwaran shankarke at gmail.com
Tue Feb 19 13:55:34 PST 2013



================
Comment at: lib/ReaderWriter/ELF/File.h:417-418
@@ -425,1 +416,4 @@
 
+        // If the linker finds that a section has global atoms that are in a 
+        // mergeable section, treat them as defined atoms 
+        int64_t sectionFlags = 0;
----------------
Michael Spencer wrote:
> Why are we treating them as defined? So they don't get merged away? This comment should explain why.
These atoms dont get merged away as well. Also take part in symbol resolution as they are defined atoms.

================
Comment at: lib/ReaderWriter/ELF/TargetHandler.h:71
@@ -68,1 +70,3 @@
+
+  virtual int64_t fixupAddend(const Reference &)const { return 0; }
 };
----------------
Michael Spencer wrote:
> They are always referred to as relocations in ELF.
will change it to relocAddend

================
Comment at: test/elf/mergeglobalatoms.objtxt:1
@@ +1,2 @@
+# ELF files can have mergeable strings which are global!, treat them as global
+# defined atoms
----------------
Michael Spencer wrote:
> This file should be named .test, not .objtxt.
ok


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



More information about the llvm-commits mailing list