This is an archive of the discontinued LLVM Phabricator instance.

Avoid short relocation in x86_64 large code model
Needs ReviewPublic

Authored by sanxiyn on Oct 31 2014, 5:45 AM.

Diff Detail

Event Timeline

sanxiyn updated this revision to Diff 15610.Oct 31 2014, 5:45 AM
sanxiyn retitled this revision from to Avoid short relocation in x86_64 large code model.
sanxiyn updated this object.
sanxiyn edited the test plan for this revision. (Show Details)
sanxiyn updated this revision to Diff 15613.Oct 31 2014, 5:48 AM
sanxiyn added a subscriber: Unknown Object (MLST).
rafael added inline comments.
test/CodeGen/X86/code-model-eh-frame.ll
1

You should be able to test this with llvm-mc, no?

sanxiyn added inline comments.Nov 11 2014, 12:08 AM
test/CodeGen/X86/code-model-eh-frame.ll
1

Can I? My first try used llvm-mc, but when I asked on IRC, someone (sorry, I don't remember who) answered I must pass -code-model to llc, not llvm-mc.

joerg added a subscriber: joerg.Nov 11 2014, 3:08 AM
joerg added inline comments.
lib/MC/MCObjectFileInfo.cpp
277

I'd prefer to do a positive check for Small and Medium. JIT for example likely wants to get sdata8 too.

lhames added a subscriber: lhames.

Ping. Looks reasonable to me, but I'm not an ELF (or DWARF) expert. This like it would fix https://bugs.llvm.org//show_bug.cgi?id=21423, and part of https://bugs.llvm.org//show_bug.cgi?id=15356.

joerg added a comment.Apr 20 2017, 3:43 PM

My point remains.

RKSimon added a subscriber: RKSimon.
RKSimon added inline comments.
test/CodeGen/X86/code-model-eh-frame.ll
1

@rafael's comment still remains - why isn't this an MC test?

echristo added inline comments.Apr 26 2017, 5:10 PM
test/CodeGen/X86/code-model-eh-frame.ll
1

Agreed. You can do something like the following:

echristo@athyra ~/tmp> clang -S bar.c
echristo@athyra ~/tmp> llvm-mc -code-model=large bar.s -filetype=obj -o bar.o
echristo@athyra ~/tmp> llvm-objdump -r bar.o

bar.o: file format ELF64-x86-64

RELOCATION RECORDS FOR [.rela.eh_frame]:
0000000000000020 R_X86_64_PC64 Unknown

espindola edited reviewers, added: espindola; removed: rafael.Mar 15 2018, 11:03 AM