Bug 117006

Summary: binaries built against dietlibc segfault
Product: [Fedora] Fedora Reporter: Bernd Kischnick <kisch>
Component: dietlibcAssignee: Jeremy Katz <katzj>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: byte
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-05-07 17:55:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 114961    

Description Bernd Kischnick 2004-02-27 10:52:14 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/124 (KHTML, 
like Gecko) Safari/125

Description of problem:
programs built with "diet gcc" don't run because the startup object file 
/usr/lib/dietlibc/lib-%{arch}/start.o
is stripped by the brp-strip script during the RPM build.

Version-Release number of selected component (if applicable):
0.24-3

How reproducible:
Always

Steps to Reproduce:
1. echo "int main () { return 0; }" > a.c
2. diet gcc a.c
3. ./a.out
4. nm /usr/lib/dietlibc/lib-%{arch}/start.o

Actual Results:  After step 2:
/usr/bin/ld: warning: cannot find entry symbol _start; defaulting to 08048074

After step 3:
Segmentation fault

After step 4:
no symbols

Expected Results:  
2. no warning from ld
3. ./a.out should run
4. 
         U __vsyscall
00000000 T _start
         U environ
         U exit
         U main


Additional info:

This can be fixed in the spec file:
%define __os_install_post /usr/lib/rpm/brp-compress

(thereby disabling the scripts brp-strip and brp-strip-comment-note).

The library itself, apart from start.o, will still be stripped.
This is already performed by the Makefile.

Comment 1 Jeremy Katz 2004-03-04 23:29:01 UTC
Fixed in -4

Comment 2 Colin Charles 2004-05-07 17:53:46 UTC
Just tried this:
[byte@potter byte]$ echo "int main () {return 0; }" >a.c
[byte@potter byte]$ diet gcc a.c
[byte@potter byte]$ ./a.out
[byte@potter byte]$ nm /usr/lib/dietlibc/lib-i386/start.o
         U environ
         U exit
         U main
00000000 T _start
         U __vsyscall

This in dietlibc-0.24-4, from fedora development tree.