The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Reading ELF file Symbol table of C++ program vinod_chitrali High Level Programming 2 08-02-2009 11:54 AM
Reading ELF file Symbol table of C++ program vinod_chitrali Linux 0 08-01-2009 03:15 PM
Check the record count in table (table in oracle) kamineni Shell Programming and Scripting 1 12-15-2008 08:31 AM
how to view symbol table in unix saravanan_nitt High Level Programming 1 02-14-2008 01:02 AM
no symbol table Dom_Cyrus High Level Programming 2 01-31-2006 09:15 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 4 Weeks Ago
shamrock shamrock is offline Forum Advisor  
Registered User
  
 

Join Date: Oct 2007
Location: USA
Posts: 753
Quote:
Originally Posted by MrUser View Post
Hi,
is there any command to see symbol table info.
will it show where its allocating memory for varibales golbals & locals and code.(i mean the segments).
Try using nm or odump for that.
Quote:
Originally Posted by MrUser View Post
i read there is a section called read only data segment and this is where initialized data such as strings stores.
If you use gdb to get the address of the string literal you will find that it is in the address range of the text segment which is readonly.
Quote:
Originally Posted by MrUser View Post
i have wriiten the following program and its giving segmentation for strings but not others.

any idea whats the proper reason.


Code:
char *p="test";
int g=10;
int main()
{
g=20;// no segmentation
printf("%d",g);
getchar();
        *p='T';// generates segmentation
printf("%s",p);
return 0;
}



thanks in advnace
A string literal cannot be modified since it is stored in the text segment which is shared and readonly.
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:47 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0