Article View: gnu.gcc.help
Article #50451Re: Gas query - allocating data in segments...
From: john e. clark
Date: Fri, 01 Oct 1993 19:30
Date: Fri, 01 Oct 1993 19:30
56 lines
2268 bytes
2268 bytes
In article <KILLIAN.93Sep24232641@realgar.epcc.ed.ac.uk> killian@realgar.epcc.ed.ac.uk (Killian Murphy) writes: + +The context for this is to place rcs Id strings into the executable. I +want to do this using asm instructions because the compiler generates +lots of unused identifier type warnings when static char *rcsid="$Id$" +is used, and this cannot be done at all to allow header file id's to +be seen, as multiple headers may be included. Sure, each header could +use a unique name, but hey, that wouldn't be a challenge ... One way to 'solve' this is to have in each *.c and *.h static const char rcsid_<filename_c[] = "$Id$"; and static const char rcsid_<filename>_h[] = "$Id$"; If there is a potential name colision on the include files then something like: static const char rcsid_path_to_filename_h[] could be used. A shell script and the use of 'sed' could automate the process of puting these declarations in. Otherwise, use of assembler directives, although possible, could lead to some unexplained failures. In particular, asm( ".data" ); asm( ".word 0xdeadface" ); asm( ".text" ); would be required, but this clutters up initialized data, and the location of the stamp string is now distant from the module which is stamped. the 'static const char' form is suppose to imbed it in the text segment. (Although that may be an implementation dependent thing as to where 'strings' are allocated even when put in a 'non-writeable' segment). -- John Clark wa137@sdcc12.ucsd.edu
Technical Details
Message-ID:
<54930@sdcc12.ucsd.edu>Path:
arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!udel!gatech!emory!nigel.msen.com!caen!uwm.edu!ogicse!network.ucsd.edu!sdcc12!wa137References:
<KILLIAN.93Sep24232641@realgar.epcc.ed.ac.uk>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,e2fa43488dc69896 X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1993-10-01 13:15:08 PST Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!udel!gatech!emory!nigel.msen.com!caen!uwm.edu!ogicse!network.ucsd.edu!sdcc12!wa137 From: wa137@sdcc12.ucsd.edu (john e. clark) Newsgroups: gnu.gcc.help Subject: Re: Gas query - allocating data in segments... Message-ID: <54930@sdcc12.ucsd.edu> Date: 1 Oct 93 19:30:46 GMT Article-I.D.: sdcc12.54930 References: <KILLIAN.93Sep24232641@realgar.epcc.ed.ac.uk> Sender: news@sdcc12.ucsd.edu Organization: University of California, San Diego Lines: 56 Nntp-Posting-Host: sdcc12.ucsd.edu