Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Professional Assembly Language
This is the forum to discuss the Wrox book Professional Assembly Language by Richard Blum; ISBN: 9780764579011
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Assembly Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old April 20th, 2007, 02:43 PM
Registered User
Join Date: Apr 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default static linking question

I have been trying to compile the paramtest1.s example in chapter 11 with _start changed to main with gcc version 4.1.2 (Ubuntu 4.1.2-0ubuntu4) and have always got a segmentation fault. Using the commands as -g -o paramtest1.o paramtest1.s and
ld -dynamic-linker /lib/ld-linux.so.2 -lc -o paramtest1 paramtest1.o
everything works as expected. What is needed to make this work as a static executable?

  #2 (permalink)  
Old April 24th, 2007, 11:51 AM
Registered User
Join Date: Apr 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts

On Ubuntu 7.04 default install I got this to work with:

gcc -static /usr/lib/crtn.o -lc paramtest1.s

gcc version is 4.4.2 (Ubuntu 4.1.2-0ubuntu4)

Similar Threads
Thread Thread Starter Forum Replies Last Post
static fileds angelboy C# 2005 3 August 5th, 2007 06:31 AM
non-static reports to static html files miamikk ASP.NET 2.0 Basics 0 June 4th, 2007 01:48 PM
Question regarding linking and moving - any advice Kirok Java Basics 1 November 10th, 2005 10:32 AM
Security of DLL vs static linking davidlock C++ Programming 1 April 21st, 2005 03:26 AM
Button linking question hlchuah77 Javascript How-To 4 September 18th, 2004 05:43 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.