From owner-freebsd-questions@FreeBSD.ORG Tue Aug 30 03:29:27 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 49ED516A41F for ; Tue, 30 Aug 2005 03:29:27 +0000 (GMT) (envelope-from jcm@FreeBSD-uk.eu.org) Received: from xenial.mcc.ac.uk (xenial.mcc.ac.uk [130.88.203.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id DDCB243D45 for ; Tue, 30 Aug 2005 03:29:26 +0000 (GMT) (envelope-from jcm@FreeBSD-uk.eu.org) Received: from dogma.freebsd-uk.eu.org ([130.88.200.97]) by xenial.mcc.ac.uk with esmtp (Exim 4.51 (FreeBSD)) id 1E9woN-0001go-Bu for freebsd-questions@freebsd.org; Tue, 30 Aug 2005 04:29:23 +0100 Received: from dogma.freebsd-uk.eu.org (localhost [127.0.0.1]) by dogma.freebsd-uk.eu.org (8.13.1/8.13.1) with ESMTP id j7U3TIwj039842 for ; Tue, 30 Aug 2005 04:29:18 +0100 (BST) (envelope-from jcm@dogma.freebsd-uk.eu.org) Received: (from jcm@localhost) by dogma.freebsd-uk.eu.org (8.13.1/8.12.6/Submit) id j7U3TIwc039841 for freebsd-questions@freebsd.org; Tue, 30 Aug 2005 04:29:18 +0100 (BST) Date: Tue, 30 Aug 2005 04:29:18 +0100 From: Jonathon McKitrick To: freebsd-questions@freebsd.org Message-ID: <20050830032917.GA39730@dogma.freebsd-uk.eu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i Subject: Linking standalone NASM binary with libc X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Aug 2005 03:29:27 -0000 Hi all, I'm doing some experimentation with assembly code based on the int80h.org tutorials. But since I am going to use malloc and some other functions, I need to make my code link with libc rather than stand totally on its own. ld -s -o foo foo.o -lc leaves 'environ' and '__progname' undefined. What is the correct way to link standalone asm code with needed libraries? jm --