This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Creating overlays with symbol duplication within one ELF file


Hi,
Is any way to mark some symbols "semi-global", which can be visible to
linker within only one section (section A has same global symbols as
section B) to prevent symbol conflicts? Or link specified object files to
the one huge object file which can be used by final link?

I'm trying to change toolchain of my project to GNU binutils. Currently
project is written on Z80 assembler.
My project contains one global module and about two hundreds of overlay
modules. An overlay module contains export table, which is used by global
module to access functions of the overlay. One overlay may access another
one via global module call (overlays have same VMA, change between overlays
are done by memory page witching). Overlays uses shared symbols of global
module directly (CALL symbol, for example).
My old toolchain supports special .module <name> directive, which declares
namespace for all symbols, starting by underscore. It is used to declare
file local symbols. Because old toolchain has no linker, so all sources of
each overlay are compiled as one file. GNU AS cannot do that due to symbol
name conflict.
Now I try to build all sources separately. But there is another issue.
Module object files cross-reference symbols (mod1/file1.o need symbols from
mod1/file2.o...mod1/file10.o). So I need declare these symbols global. But
other overlay modules has identical symbols (overlay modules are very
similar, moreover, some overlays shares source files), so they cause link
time conflicts.
Is any way to resolve it? Currently I see only one way: make all modules as
separate executables and share exported symbols by generated include files.

Best regards,
Sergey Belyashov


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]