All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nigel Stephens <nigel@mips.com>
To: zhuzhenhua <zzh.hust@gmail.com>
Cc: Thiemo Seufer <ths@networkno.de>, linux-mips <linux-mips@linux-mips.org>
Subject: Re: BFD: Warning: Writing section `.text' to huge (ie negative) file offset 0xa1ffff10
Date: Fri, 02 Jun 2006 12:00:41 +0100	[thread overview]
Message-ID: <44801A59.5080508@mips.com> (raw)
In-Reply-To: <50c9a2250606011749r7f89fbben2c61edd43c7ec0a6@mail.gmail.com>



zhuzhenhua wrote:
>
>>
>> I think the problem is not with the linker, but in your use of objcopy
>> to convert your ELF file to a raw binary file.
>>
>> 1) What arguments are you giving to mipsel-linux-objcopy?
> i use objcopy as follow(the brec_flash is elf file)
>     mipsel-linux-objcopy -O binary brec_flash brec_flash.bin
>>
>> 2) What is the output from mipsel-linux-objdump -h run on your
>> intermediate ELF object file?
> i use mipsel-linux-objdump -h brec_flash and get messages as follow
>
>
> brec_flash:     file format elf32-tradlittlemips
>
> Sections:
> Idx Name          Size      VMA       LMA       File off  Algn
>  0 .text         0000b140  72000000  72000000  00010000  2**4
>                  CONTENTS, ALLOC, LOAD, READONLY, CODE
>  1 .data         00001080  7200b140  7200b140  0001b140  2**4
>                  CONTENTS, ALLOC, LOAD, DATA
>  2 .sbss         00000010  7200c1c0  7200c1c0  0001c1c0  2**2
>                  ALLOC
>  3 .bss          000008a0  7200c1d0  7200c1d0  0001c1c0  2**4
>                  ALLOC
>  4 .reginfo      00000018  7200ca70  7200ca70  0001ca70  2**2
>                  CONTENTS, ALLOC, LOAD, READONLY, DATA, 
> LINK_ONCE_SAME_SIZE
>  5 .pdr          000011a0  00000000  00000000  0001ca88  2**2
>                  CONTENTS, READONLY
>  6 .mdebug.abi32 00000000  00000000  00000000  0001dc28  2**0
>                  CONTENTS, READONLY
>  7 .comment      000000ea  00000000  00000000  0001dc28  2**0
>                  CONTENTS, READONLY
>  8 .rodata       00000190  000000f0  000000f0  000000f0  2**4
>                  CONTENTS, ALLOC, LOAD, READONLY, DATA
>  9 .rodata.str1.4 000005fe  00000280  00000280  00000280  2**2
>                  CONTENTS, ALLOC, LOAD, READONLY, DATA

OK. I think that the final .rodata.str1.4 section is causing your 
problem because the offset between its load address and the other 
section is huge, causing "objcopy -O binary" to generate a huge file. 
This is a new section generated by gcc 3.x and above to hold mergeable 
constant data. Try changing the line in your linker script which (I'm 
guessing here) probably looks like this:

    *(.rodata)

to:

     *(.rodata) *(.rodata.*)

Nigel

  parent reply	other threads:[~2006-06-02 11:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-01  6:19 BFD: Warning: Writing section `.text' to huge (ie negative) file offset 0xa1ffff10 zhuzhenhua
2006-06-01  9:24 ` Thiemo Seufer
2006-06-01 10:56   ` zhuzhenhua
2006-06-01 12:49     ` Nigel Stephens
2006-06-02  0:49       ` zhuzhenhua
2006-06-02  2:50         ` zhuzhenhua
2006-06-02  9:48           ` Thiemo Seufer
2006-06-02 11:00         ` Nigel Stephens [this message]
2006-06-02 11:11           ` Nigel Stephens
2006-06-03  4:36             ` zhuzhenhua

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44801A59.5080508@mips.com \
    --to=nigel@mips.com \
    --cc=linux-mips@linux-mips.org \
    --cc=ths@networkno.de \
    --cc=zzh.hust@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.