From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19704 invoked by alias); 2 Aug 2006 20:43:29 -0000 Received: (qmail 19667 invoked by uid 22791); 2 Aug 2006 20:43:28 -0000 X-Spam-Check-By: sourceware.org Received: from os.inf.tu-dresden.de (HELO os.inf.tu-dresden.de) (141.76.48.99) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 02 Aug 2006 20:43:26 +0000 Received: from p54b3256e.dip0.t-ipconnect.de ([84.179.37.110] helo=laptop.hypervisor.org) by os.inf.tu-dresden.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.62) id 1G8NYq-0004Lh-Nr for binutils@sourceware.org; Wed, 02 Aug 2006 22:43:24 +0200 Date: Wed, 02 Aug 2006 20:43:00 -0000 From: "Udo A. Steinberg" To: binutils@sourceware.org Subject: Omit output section from executable Message-ID: <20060802224324.4538786f@laptop.hypervisor.org> X-Mailer: X-Mailer 5.0 Gold Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2006-08/txt/msg00019.txt.bz2 Hi all, For an OS kernel I have put all CPU-local data in a specific ELF section named ".cpulocal". During bootstrap the kernel allocates a memory page for each CPU and maps it to the VMA of the ".cpulocal" section. I would like the linker to omit the (useless) contents of that section from the executable while still maintaining references into the section. I can achieve the desired effect by doing an objcopy -R .cpulocal after the final link. Any way I could do the same with only a linker script and without the objcopy? Thanks - Udo