473,406 Members | 2,954 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

wat is .bss segment in object file

hi all,
can any one give me some explanation of "wat is .bss segment in object
file" and what it will contain and difference between data segment
and .bss segment....

help me....

thanks,
jes

May 23 '07 #1
4 6959
In article <11*********************@w5g2000hsg.googlegroups.c om>,
<je****@gmail.comwrote:
>hi all,
can any one give me some explanation of "wat is .bss segment in object
file" and what it will contain and difference between data segment
and .bss segment....

help me....

thanks,
jes
Off topic. Not portable. Cant discuss it here. Blah, blah, blah.

Useful clc-related links:

http://en.wikipedia.org/wiki/Aspergers
http://en.wikipedia.org/wiki/Clique
http://en.wikipedia.org/wiki/C_programming_language

May 23 '07 #2
je****@gmail.com wrote:
hi all,
can any one give me some explanation of "wat is .bss segment in object
file" and what it will contain and difference between data segment
and .bss segment....
Neither "bss segments" nor "data segments" have anything to do with C. They
are both terms relating to the mechanics of compiling and loading programs in
specific environments.

Typically, a "data segment" is the part of the object module that contains
initialized static data (in C, initialized static variables, string constants,
and other stuff like that), while the "bss segment" ("Block Started by
Symbol") defines the space for unitialized static data.

For example

int main(void)
{
static char abc[12], /* located in BSS segment */
def[] = "1"; /* located in DATA segment */
static int seven; /* located in BSS segment */
static float pi = 3.14159; /* located in DATA segment */
int two = 3; /* not in BSS nor DATA */
strcpy(abc /* as above */,
"Test" /* located in DATA segment */
);

return 0;
}

HTH

--
Lew Pitcher

Master Codewright & JOAT-in-training | Registered Linux User #112576
http://pitcher.digitalfreehold.ca/ | GPG public key available by request
---------- Slackware - Because I know what I'm doing. ------

May 23 '07 #3
On 23 May 2007 07:50:49 -0700, jesjak@...com wrote:
>can any one give me some explanation of "wat is .bss segment in object
file" and what it will contain and difference between data segment
and .bss segment....
http://en.wikipedia.org/wiki/.bss
--
Roland Pibinger
"The best software is simple, elegant, and full of drama" - Grady Booch
May 23 '07 #4
je****@gmail.com writes:
can any one give me some explanation of "wat is .bss segment in object
file" and what it will contain and difference between data segment
and .bss segment....
I suggest you ask this in a newsgroup that deals with your operating
system. It's not a C language issue.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
May 23 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Stephen S M WONG | last post by:
As C++ program supports objects with constructors/destructors/methods and data items, I'll assume C++ implementation on segment model computer, like a 80286 with different access restrictions on...
4
by: cppsks | last post by:
I have been working on making a constant array available for the clients. However, it is placing it in the text segment, and external references result in unresolved references to the array. Taking...
65
by: Skybuck Flying | last post by:
Hi, I needed a method to determine if a point was on a line segment in 2D. So I googled for some help and so far I have evaluated two methods. The first method was only a formula, the second...
5
by: peter Willis | last post by:
Hello, Is there a way to recover from the following error? I have (had) an existing database and wish not to lose the data tables. Thanks for any help, Pete
1
by: nass | last post by:
hello everyone.. i am not sure what is wrong - never liked strings anyway! my problem is that i am trying to save a QCstring in a shared memory segment and i get a segmentation fault.. here is...
5
by: druberego | last post by:
I read google and tried to find the solution myself. YES I do know that you can get undefined references if you: a) forget to implement the code for a prototype/header file item, or b) you forget...
5
by: linq936 | last post by:
Hi, I hope this question belongs to this group. I am studying book <<Expert C Programming>and in the chapter of run time data structure, it mentions that BSS segment only stores the size of the...
16
by: rahul | last post by:
void foo(void) { /* blah blah */ } char buf = {....}; memcpy( (void *)&foo, buf, sizeof buf); This thing is giving segmentation fault on RHEL 5/gcc 4.1. Is the text segment protected? I am...
3
by: madshov | last post by:
Hi, I have the following: <start> <segment Id="AAA"> <element Id="id">1</element> <element Id="seq">122</element> <element Id="seq2" Composite="yes">
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.