bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/3869] The mapping behavior for small data of the ld for PowerPC,


From: nickc at redhat dot com
Subject: [Bug ld/3869] The mapping behavior for small data of the ld for PowerPC, from COMMON section to bss section.
Date: 1 Feb 2007 13:53:58 -0000

------- Additional Comments From nickc at redhat dot com  2007-02-01 13:53 
-------
Hi Tanaka,

  This is not a linker problem (or an assembler problem).  It is a compiler
issue, and you should report it on the gcc mailing list, if you think that it is
necessary.

  In fact this is not really a bug, but a feature.  What is happening is that
the two ports use different methods to decide where to place small variables. 
For the powerpc port, the decision is made by the compiler, not the linker.  For
the MIPS port the decision is made by the linker.

  With the powerpc port, common variables are not candidates for placement in
the .sbss section, which is why you are seeing the behaviour you describe.  If
you were to add the "-fno-common" switch to the gcc command line when compiling
a.c and b.c you would then find that the a1[] array is placed into the .sbss
section.  The reason that the compiler does not place common variables into the
.sbbs section is that it has no way to know the final maximum size of the 
variable.

  With the MIPS port, common variables can be placed into the .sbss section
because the placement decision is performed by the linker not the compiler. 
Since the linker knows the final sizes of all variables, including commons, it
is able to decide which variables should be placed into the .sbss section.

  You may feel that the powerpc linker should be performing the same kind of
placement optimization as the MIPS linker, but this is an enhancement not a
bug-fix.So you should find a programmer or company willing to implement this
optimization for you.

Cheers
  Nick


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


http://sourceware.org/bugzilla/show_bug.cgi?id=3869

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]