Skip to content

Commit 7fa220f

Browse files
author
George Rimar
committedJan 11, 2017
[ELF] - Ignore R_386_NONE.
We had an error when met this relocation after latest changes aboult listing x86 relocations explicitly. Since we support R_X86_64_NONE, and GNU ld supports R_386_NONE, it seems reasonable to have. Differential revision: https://reviews.llvm.org/D28552 llvm-svn: 291672
1 parent 8a9a783 commit 7fa220f

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed
 

‎lld/ELF/Target.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,8 @@ RelExpr X86TargetInfo::getRelExpr(uint32_t Type, const SymbolBody &S) const {
383383
return R_TLS;
384384
case R_386_TLS_LE_32:
385385
return R_NEG_TLS;
386+
case R_386_NONE:
387+
return R_HINT;
386388
default:
387389
error("do not know how to handle relocation " + toString(Type) + " (" +
388390
Twine(Type) + ")");
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# RUN: yaml2obj %s -o %t.o
2+
# RUN: ld.lld %t.o -o %t.out
3+
4+
# Test that we can handle R_386_NONE.
5+
6+
!ELF
7+
FileHeader:
8+
Class: ELFCLASS32
9+
Data: ELFDATA2LSB
10+
Type: ET_REL
11+
Machine: EM_386
12+
Sections:
13+
- Name: .text
14+
Type: SHT_PROGBITS
15+
Flags: [ SHF_ALLOC ]
16+
- Name: .rel.text
17+
Type: SHT_RELA
18+
Link: .symtab
19+
Info: .text
20+
Relocations:
21+
- Offset: 0x0000000000000000
22+
Symbol: ''
23+
Type: R_386_NONE

0 commit comments

Comments
 (0)
Please sign in to comment.