Linux-Bulgaria.ORG
навигация

 

начало

пощенски списък

архив на групата

семинари ...

документи

как да ...

 

 

Предишно писмо Следващо писмо Предишно по тема Следващо по тема По Дата По тема (thread)

lug-bg: c/c++ differences


  • Subject: lug-bg: c/c++ differences
  • From: firedust@email.domain.hidden (Stanislav Lechev [AngelFire])
  • Date: Fri, 4 Jul 2003 12:12:21 +0300


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

// da se chete ot po naprednali c/c++ programisti

zdrawejte move bi ne e naj prawilnoto mqsto za maila mi no wse pak
shte se probwam
w momenta pisha plugin baziran demon ...
ideqta e da zarevda plugini koito da obsluvwat razni neshtica...
znachi problema mi e sledniq

eto edna primerna c/c++ programa:
int plugin_main() {
}
- -------
eto kakwo se poluchawa pri kompilirane sys C kompilator

root_at_angelfire:[0]:utils# gcc qwe.c -c
root_at_angelfire:[0]:utils# objdump -t qwe.o
qwe.o:     file format elf32-i386

SYMBOL TABLE:
00000000 l    df *ABS*  00000000 qwe.c
00000000 l    d  .text  00000000
00000000 l    d  .data  00000000
00000000 l    d  .bss   00000000
00000000 l    d  .comment       00000000
00000000 g     F .text  00000005 plugin_main

<p>waven e posledniq red w sluchaq imeto na funkciqta e "plugin_main" kakto se 
wivda i ot symbol tabel-a

eto kakwo stawa sys C++:

root_at_angelfire:[0]:utils# g++ qwe.c -c
root_at_angelfire:[0]:utils# objdump -t qwe.o

qwe.o:     file format elf32-i386

SYMBOL TABLE:
00000000 l    df *ABS*  00000000 qwe.c
00000000 l    d  .text  00000000
00000000 l    d  .data  00000000
00000000 l    d  .bss   00000000
00000000 l    d  .comment       00000000
00000000 g     F .text  00000005 _Z11plugin_mainv

kakto wivdame w C++ funkciqta e sys ime "_Z11plugin_mainv"
koeto weroqtno e zaradi polimorfizma
ili pone taka si go obqsnqwam az ...
wyprosa mi e sledniq 
kogato se opitwam da zaredq plugina si ...
az napraktika ne mu znam imenata na funkciite
kogato sa kompilirani na C++
znam che ima wariant sys dummy funkcii prez C da go prekaram
no ne me ustrojwa...
interesnoto e che na razlichnite versii na libc/glibc 
tezi prefix i suffix: _Z11 i v
sa razlichni...

wyprosa mi e kak po dqwolite da si adresiram prawilno funkciqta
sled kato ne znam imeto i...

za momenta sym si reshil problema po sledniq nachin
oshte ot configure scripta
si izpylnqwam edno perl scriptche koeto kompilira takawa
malka programka i parswa rezultata ot objdump-a
po tozi nachin wadq prefix i suffix koito wkarwam s DEFINE-owe
w programata si...
ne che ne stawa po tozi nachin no mi se wivda mnogo dyrweno...
10x in advance...

- -- 
- -=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-
  Regards,                                            AngelFire  
      Stanislav Lechev                    <firedust_at_vega.bg>     
     PGP Key: http://firedust.vega.bg/pgp/StanislavLechev.asc    
   Vega Internet Service Provider (tm)  --  http://www.vega.bg   
- -=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-

<p>-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/BUT28RPXBhiMqewRAjhJAKCLC9OcPw166EI3TeTgZ5/J0MCTxACfVSiI
VUW6ZL90gWHdhuF+YRD3Sbs=
=aZph
-----END PGP SIGNATURE-----
============================================================================
A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers).
http://www.linux-bulgaria.org - Hosted by Internet Group Ltd. - Stara Zagora
To unsubscribe: http://www.linux-bulgaria.org/public/mail_list.html
============================================================================



 

наши приятели

 

линукс за българи
http://linux-bg.org

FSA-BG
http://fsa-bg.org

OpenFest
http://openfest.org

FreeBSD BG
http://bg-freebsd.org

KDE-BG
http://kde.fsa-bg.org/

Gnome-BG
http://gnome.cult.bg/

проект OpenFMI
http://openfmi.net

NetField Forum
http://netField.ludost.net/forum/

 

 

Linux-Bulgaria.ORG

Mailing list messages are © Copyright their authors.