LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-27-2006, 09:11 AM   #1
magham_rajesh
LQ Newbie
 
Registered: Jun 2006
Posts: 4

Rep: Reputation: 0
elf executable size problem


Hi all,
I'm building executables from a set of object files and none of the object file is created in debug mode i.e no -g option is used, still the compiler/ld is putting debug sections and .symtab sections under section header colomns in the elf executables causing the size to increase substantially, i know a "strip" would do the needful but i don't want to do that, i wrote a test program and compiled it and was surprised to see these sections in its executable too. This is the output of gcc -v :-
a$ gcc -v

Reading specs from /lib/gcc-lib/i686-pc-linux-gnu/3.2.2/specs
Configured with: ../gcc-3.2.2/configure --prefix=/gcc-3.2.2-nonshared --with-gnu-as --with-as=/binutils-2.13/bin/as --with-gnu-ld --with-ld=/binutils-2.13/bin/ld --disable-shared
Thread model: posix
gcc version 3.2.2

The architecture is red-hat linux 7.2, kernel is 2.4.7-10,

for further information feel free to contact me.

Thanks,
Rajesh
 
Old 06-27-2006, 09:29 AM   #2
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
So strip them. It works. Problem solved.
 
Old 06-27-2006, 12:16 PM   #3
magham_rajesh
LQ Newbie
 
Registered: Jun 2006
Posts: 4

Original Poster
Rep: Reputation: 0
yeah dats an option, but as i mentioned, i don't want to do that, can you suggest any alternative approach ?? \
 
Old 06-27-2006, 12:31 PM   #4
jim mcnamara
Member
 
Registered: May 2002
Posts: 964

Rep: Reputation: 36
Some compilers (not gcc) offer an -s option. This produces a stripped executable.

What kind of "other choice" are you after - there are none short of writing your own version strip and incorporating it into your compiler....?
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing ELF of the executable file ? vishalbutte Programming 3 12-30-2005 12:52 PM
Executable size - RH7.x versus Fedora Dave31836 Red Hat 1 03-04-2005 02:46 PM
ELF 32-bit LSB executable how to run vinsky2002 Linux - Software 1 01-12-2005 02:07 AM
X11 library problem wrong ELF size chewysplace Linux - Software 1 04-12-2004 02:40 PM
problem executable sol Linux - General 3 09-18-2001 02:33 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration