473,802 Members | 1,971 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 6987
In article <11************ *********@w5g20 00hsg.googlegro ups.com>,
<je****@gmail.c omwrote:
>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.co m 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.co m 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_Keit h) 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
1966
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 code segment / data segment / etc., will force all objects to be resided in a code segment, so that executable code can be there as well as data. And effectively bypassing all segment model. Any comments on the above?
4
2849
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 the const off the definition solves the problem (the variable is placed in the data segment). Is this how const globals are supposed to work, or did the linker screw up? Thanks.
65
12629
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 method was a piece of C code which turned out to be incorrect and incomplete but by modifieing it would still be usuable. The first method was this piece of text:
5
7743
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
2450
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 the case statement that causes the trouble.. i could post the whole procedure but there is no point. similar case statements as the following one exisst in the procedure that save in the same memory segment (but at dif offest) floats, Q_UINT8 and...
5
11364
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 to pass all the necessary object files to the linker. Neither of those are my problem. Please bear with me as the question I ask is rather long and I think it's beyond a CS101 level of linker stupidity. If it is a stupid CS101 mistake I'm making...
5
2628
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 un-initialized data, it does not have the data images, so it does not take up any actual space in the object file. I tried out a simple code, but it is not as said.
16
2526
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 assuming foo has enough space for buf.
3
2156
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
9699
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10538
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10285
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10063
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9115
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5494
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4270
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2966
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.