Re: export symbols

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I know it's been a long since i first send my question.. but i'm still stucked.
Versioning symbols does not add them to dynsym table.

Maybe i explained myself in the wrong way:

- I got host program P, with its functions and i want only one to be
seen by modules (function F).

- In the other side i got a program M (module), that is loaded by P
and then it uses the F function from P.

If i compile with -rdynamic option in gcc, it works fine but it
exports all the functions on .dynsym.

Using versioning, and adding this on my code:

__asm__(".symver F,  F@");

Only adds F@ to .symtab, but not to .dynsym. So when executing the
program i get the following message:

./main: symbol lookup error: ../mod/log: undefined symbol: F


And i tried to  --dynamic-list option.. but with no results.

Any idea or tip??

Thanks!!



On Sat, Apr 25, 2009 at 11:15 PM, Andi Hellmund<mail@xxxxxxxxxxxxxxxx> wrote:
> Ian Lance Taylor wrote:
>> Alberich de megres <alberich2k5@xxxxxxxxx> writes:
>>
>>
>>> but i just want to export some of symbol on main.c. Is it some way to
>>> control which symbols i export?
>>>
>>
>> http://sourceware.org/binutils/docs-2.19/ld/VERSION.html
>>
>> Ian
>>
>>
> Beside the versioning of symbols, you could also use use one of the
> following ld commands (check out the man page for more details):
>
> --exclude-symbols symbol,symbol,...
>
> --dynamic-list=dynamic-list-file
>
> If you are using gcc for linking, then prepend -Wl, to the command, like
> -Wl,--exclude-symbols,...
>
> Hope that helps and best regards,
> Andi
>
>

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux