This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Any MIPS experts?


----Original Message----
>From: Maciej W. Rozycki
>Sent: 23 September 2005 16:30

> On Thu, 22 Sep 2005, Dave Korn wrote:
> 
>>> This removes the weird separate .data for "traditional" (linux-like)
>>> mips. Also, in some cases ld -N may be acceptable as a workaround for
>>> the problem.
>> 
>> 
>>   Brilliant.  Thanks a load Thiemo!
> 
>  Note that the increased alignment shouldn't actually affect the size of
> files generated, as trailing padding for segments is supported for ELF
> without occupying file space (cf "file size" vs "memory size" for
> segments).  Thus if that's what happens, then there is a problem with that
> particular toolchain.
> 
> $ cat main.c
> int main(void)
> {
> 	return 0;
> }
> $ mipsel-linux-gcc -o main main.c
> $ ls -la main
> -rwxr-xr-x  1 macro macro 7378 Sep 23 16:21 main
> 
>   Maciej

     Hi Maciej, 

  What binutils and gcc versions did you use for that?  And can we compare
the output from "mipsel-linux-objdump -x main" with the kind of thing we
were seeing at e.g.

http://sources.redhat.com/ml/crossgcc/2005-09/msg00169.html

I'm not familiar with PHDRS, but I /think/ that these lines:

    LOAD off    0x00000000 vaddr 0x00400000 paddr 0x00400000 align 2**16
         filesz 0x00000ac0 memsz 0x00000ac0 flags r-x
    LOAD off    0x00010000 vaddr 0x10000000 paddr 0x10000000 align 2**16
         filesz 0x00000090 memsz 0x000000a0 flags rw-

indicate that the second LOAD section has been aligned in the output file
according to its load-time alignment.  The filesz field shows that there's
hardly any data in each, but the off field shows that the data segment is at
64kB in the file, doesn't it?


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]