NASM Forum > Summer of Code Ideas

Must have feature - Renaming exports


I think NASM (even though Linker support is also required) should provide a feature to rename functions and variables.
For example, if we are importing c's printf, we could do something like:

extern _printf as _cprint

so, througout the remainder of the code, we refer to the name _cprint, which in turns, refer to executable snippet
that was under the name _printf.

However, I recognize the fact that for the functionality to work, a linker that supports the functionality is required.  In this case,
the linker would change the original name to the new one you set when it copies the object code, that the function or variable, is from into the PE, dll or static library file.

It would be the same for exports.

For example,

global myfunc as superfunc
The latter may not require much linker support.

The Netwide Assembler Team has made a great Assembler (NASM) and a great Disassembler (NDISASM); why
not also make a netwide linker? One, that's not only a great linker, but also do special things to support NASM special

Cyrill Gorcunov:
> extern _printf as _cprint

I believe you can use macros for that and define any aliases you like.

> why not also make a netwide linker

Because it's a lot of work. But we would happily accept contributions/patches.

And is it possible to have a documentation of how nasm work (about source-code) and why not a guideline of source-code for a faster understanding = faster produce of contributions/patches.

Maybe the commentary of source-code can seem enough but, I have a little difficult to read them and make the link directly to other codes x)

Cyrill Gorcunov:
Having docs about nasm internals is really a problem, for the very same reason -- lack of time. After all the code is changed all the time (well, novadays not frequently but still), so you'll have to read source code anyway.

You may build the nasm with debug info and run assmebling of some file under debugger so you'll see how code flows.


[0] Message Index

Go to full version