From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13316 invoked by alias); 18 Dec 2007 10:19:23 -0000 Received: (qmail 13308 invoked by uid 22791); 18 Dec 2007 10:19:22 -0000 X-Spam-Check-By: sourceware.org Received: from an-out-0708.google.com (HELO an-out-0708.google.com) (209.85.132.244) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 18 Dec 2007 10:19:11 +0000 Received: by an-out-0708.google.com with SMTP id c23so776665anc.42 for ; Tue, 18 Dec 2007 02:19:09 -0800 (PST) Received: by 10.100.201.16 with SMTP id y16mr17042355anf.83.1197973149016; Tue, 18 Dec 2007 02:19:09 -0800 (PST) Received: from ghost ( [221.218.184.181]) by mx.google.com with ESMTPS id 52sm278306hsf.2007.12.18.02.19.02 (version=SSLv3 cipher=OTHER); Tue, 18 Dec 2007 02:19:07 -0800 (PST) Date: Tue, 18 Dec 2007 10:19:00 -0000 From: "PRC" To: Daniel Jacobowitz Cc: pkoning , binutils References: <20071209200658.GA26653@caradoc.them.org>, <200712110919091773244@gmail.com>, <20071211125855.GA25143@caradoc.them.org> Subject: Re: Re: Re: How to inform the linker not to produce any data for a.bsssection? Message-ID: <200712181818332958067@gmail.com> X-mailer: Foxmail 6, 9, 201, 16 [cn] Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: 7bit Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2007-12/txt/msg00102.txt.bz2 Hi, Jacobowitz Can you tell me how to modify the link script to prevent .bss taking up space in file? I didn't grap your meanings and have no idea what to do. On Tue, Dec 11, 2007 at 09:19:12AM +0800, PRC wrote: > mips-elf-objdump -h a.out > ------------------------------------------------------------------- > 3 .bss 00010620 81413898 81413898 00003898 2**3 > ALLOC > 4 .reginfo 00000018 00000000 00000000 00013eb8 2**2 > CONTENTS, READONLY, LINK_ONCE_SAME_SIZE > ------------------------------------------------------------------ > The difference between sections ".bss" and ".reginfo" is almost 64K, > which is just the size of the buffer `cmd_buffer`. And I check the > output file, and find there are lots of zero starting from the offset > 0x3898. It seems the linker puts 64K zeros in the section ".bss". This is necessary alignment. If you don't want .bss to take up space in the file, do not put allocated sections after it. -- Daniel Jacobowitz CodeSourcery