Hi, I am trying to undertand which code in LLVM patches the fixups generated by assembler. Here is what I am doing: I use "llvm-mc" to compile X86 assembly code, like below: $ echo "jmp 5000" | ./bin/llvm-mc -assemble -triple=i386 -show-encoding -x86-asm-syntax=att -output-asm-variant=1 .text jmp 5000 # encoding: [0xeb,A] # fixup A - offset: 1, value: 5000-1, kind: FK_PCRel_1 Now there are fixups in the encoding, and this must be patches by LLVM somewhere. My best guess is that the next phase after assembly compilation will patch them, but not very sure where in LLVM compiler does this. Any hints on how the compiler patch the fixups after assembler phase? (a pointer to source code is great, so i can read the source and have better understanding) Thanks, Jun -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160216/3b41d7ec/attachment.html>
On 2/16/2016 7:04 AM, Jun Koi via llvm-dev wrote:> > I am trying to undertand which code in LLVM patches the fixups generated > by assembler. >What do you mean exactly? The actual machine code is generated by MCCodeEmitter, for example lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp The relocations from the object files are applied by the linker, not LLVM. -Krzysztof -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
On Tue, Feb 16, 2016 at 10:59 PM, Krzysztof Parzyszek via llvm-dev < llvm-dev at lists.llvm.org> wrote:> On 2/16/2016 7:04 AM, Jun Koi via llvm-dev wrote: > >> >> I am trying to undertand which code in LLVM patches the fixups generated >> by assembler. >> >> > What do you mean exactly? The actual machine code is generated by > MCCodeEmitter, for example > lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp > > The relocations from the object files are applied by the linker, not LLVM. >Do you mean the LLVM linker will do the relocation? Do you have any hints on where to look at linker source of LLVM to see how this is done? Thanks.> > -Krzysztof > > > -- > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted > by The Linux Foundation > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160216/a40df26c/attachment.html>
Possibly Parallel Threads
- Who patches the fixups?
- [LLVMdev] [RFC PATCH 1/2] x86: Fix ModR/M byte output in 16-bit addressing mode
- [LLVMdev] how to interpret MRMDestReg in X86InstrFormat.td?
- Issues in Vector Add Instruction Machine Code Emission
- Issues in Vector Add Instruction Machine Code Emission