[PATCH] D28552: [ELF] - Ignore R_386_NONE.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 11 03:01:41 PST 2017


grimar created this revision.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar, evgeny777.

R_X86_64_NONE is ignored starting from r288485,
I guess we want to do the same for R_386_NONE ?
Currently we error out this relocation as not supported and
ignoring seems to be correct behavior.


https://reviews.llvm.org/D28552

Files:
  ELF/Target.cpp
  test/ELF/relocation-none-i686.test


Index: test/ELF/relocation-none-i686.test
===================================================================
--- test/ELF/relocation-none-i686.test
+++ test/ELF/relocation-none-i686.test
@@ -0,0 +1,23 @@
+# RUN: yaml2obj %s -o %t.o
+# RUN: ld.lld %t.o -o %t.out
+
+# Test that we can handle R_386_NONE.
+
+!ELF
+FileHeader:
+  Class:           ELFCLASS32
+  Data:            ELFDATA2LSB
+  Type:            ET_REL
+  Machine:         EM_386
+Sections:
+  - Name:            .text
+    Type:            SHT_PROGBITS
+    Flags:           [ SHF_ALLOC ]
+  - Name:            .rel.text
+    Type:            SHT_RELA
+    Link:            .symtab
+    Info:            .text
+    Relocations:
+      - Offset:          0x0000000000000000
+        Symbol:          ''
+        Type:            R_386_NONE
Index: ELF/Target.cpp
===================================================================
--- ELF/Target.cpp
+++ ELF/Target.cpp
@@ -383,6 +383,8 @@
     return R_TLS;
   case R_386_TLS_LE_32:
     return R_NEG_TLS;
+  case R_386_NONE:
+    return R_HINT;
   default:
     error("do not know how to handle relocation " + toString(Type) + " (" +
           Twine(Type) + ")");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28552.83940.patch
Type: text/x-patch
Size: 1177 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170111/303ed845/attachment-0001.bin>


More information about the llvm-commits mailing list