Very basic FASM question?

Everything else that doesn't fall into one of the other PB categories.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Very basic FASM question?

Post by srod »

Hi,

'scuse the schoolboy type question, but I'm not that familiar with FASM. I thought I'd ask here as it's obvious that there are some very skilled fasm programmers around these parts.

Using FASM to create an MS COFF object file.

I'm just wondering under which circumstances code labels end up in the coff symbol table?

If I use a regular unscoped label (e.g. MyLabel: etc.) which is accessible throughout the source file, does this end up in the symbol table and thus become accessible to all other object files being linked (with the extern directive)? I'm hoping not!

I'm hoping that there is some directive (e.g. global) which will cause the label to be placed in the symbol table so that I effectively can choose which labels end up in the symbol table.

Thanks in advance.
I may look like a mule, but I'm not a complete ass.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Code: Select all

public symbol
will place the symbol in the symbol table.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Wow, that was quick! :)

So the absence of 'Public' will prevent the label from being placed in the symbol table?

That's great, just what I need and what I needed to know.

Thanks.
I may look like a mule, but I'm not a complete ass.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

srod wrote:So the absence of 'Public' will prevent the label from being placed in the symbol table?
I think so. At least it won't be accessible to other files.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Which means that it can't be in the symbol table then! Good.

I mostly use GoAsm, which is great, but it places all unscoped code labels within the symbol table automatically, which is causing problems for a certain piece of code I'm working on. Hence the switch to FASM for this piece of code.

Thanks again.
I may look like a mule, but I'm not a complete ass.
Post Reply