flat assembler
Message board for the users of flat assembler.

Index > Main > n00b: Who creates relocation?

Author
Thread Post new topic Reply to topic
halivingston



Joined: 04 Aug 2015
Posts: 2
halivingston 04 Aug 2015, 20:25
So I built a compiler in college, but we were generating MASM assembly like:

proc FooBar

... do something


proc FooBar2
call FooBar


Now I'm doing a job where their compiler is emitting x86 assembly, but is also emitting relocations. I'm confused as to how it is emitting relocations? How does it know where to put relocations anyway?

Isn't that the assembler/linker's job?

Is there like a book that explains this? It seems that is a very platform specific detail and OS specific detail so maybe there are multiple books?

P.S. - Sorry for asking such a vague question. I'm sort of lost.
Post 04 Aug 2015, 20:25
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2909
Location: 0x77760000
typedef 05 Aug 2015, 00:36
Quote:
How does it know where to put relocations anyway?


Maybe you should revisit the PE format documentation. Wink
Post 05 Aug 2015, 00:36
View user's profile Send private message Reply with quote
Kevin_Zheng



Joined: 04 Jul 2003
Posts: 125
Location: China
Kevin_Zheng 05 Aug 2015, 16:36
DOS MZ will support one very simly relocation table in that it, I recommend that you maybe work in DOS MZ format. The reaosn is that the DOS MZ format support one very simply relocation table., it's easy than PE format; and second reason is that DOS MZ format only support 16bit insturction , but PE format uses 32BIT and 64bit instructions, it maybe block you to understand it.

Thanks.

Kenneth Zheng

_________________
Pure Assembly Language Funs
Post 05 Aug 2015, 16:36
View user's profile Send private message MSN Messenger Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.