public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Creating overlays with symbol duplication within one ELF file
@ 2020-03-04 14:10 Sergey Belyashov
  0 siblings, 0 replies; only message in thread
From: Sergey Belyashov @ 2020-03-04 14:10 UTC (permalink / raw)
  To: Binutils

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-03-04 14:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-04 14:10 Creating overlays with symbol duplication within one ELF file Sergey Belyashov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).