[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
This commit is contained in:
George Rimar 2017-01-11 14:20:13 +00:00
parent 8a9a783f2c
commit 7fa220f5f1
2 changed files with 25 additions and 0 deletions

View File

@ -383,6 +383,8 @@ RelExpr X86TargetInfo::getRelExpr(uint32_t Type, const SymbolBody &S) const {
return R_TLS; return R_TLS;
case R_386_TLS_LE_32: case R_386_TLS_LE_32:
return R_NEG_TLS; return R_NEG_TLS;
case R_386_NONE:
return R_HINT;
default: default:
error("do not know how to handle relocation " + toString(Type) + " (" + error("do not know how to handle relocation " + toString(Type) + " (" +
Twine(Type) + ")"); Twine(Type) + ")");

View File

@ -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