http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46072
mrgcc at mailinator dot com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mrgcc at mailinator dot com --- Comment #31 from mrgcc at mailinator dot com 2011-05-20 08:02:27 UTC --- Hi *, just my 2 cents >From my poor understanding, to mee this seems like an "as" issue. >From the same .s input the "old" and "new" as produces different .o files. The dump util on the two .o shows more clear what the linker tries to say testcode: static int globstat; int main() { static int innerstat; return 0;} new as: [48] m 0x00000000 1 0 0x8f 0x0000 .bs ---------------------^ should be pointing to 68 = 0x44 and is illegal according to the specs [49] m 0x00000004 -2 0 0x85 0x0000 innerstat:V3 [50] m 0x00000000 1 0 0x90 0x0000 .es [51] m 0x00000010 1 1 0x64 0x0000 .eb [52] a1 2 0 0 0 0 [53] m 0x00000020 1 1 0x65 0x0000 .ef [54] a1 0 2 0 0 0 [55] m 0x00000000 1 0 0x8f 0x0000 .bs ---------------------^ [56] m 0x00000000 -2 0 0x85 0x0000 globstat:S3 [57] m 0x00000000 1 0 0x90 0x0000 .es [58] m 0x00000038 2 1 0x6b 0x0000 _test.rw_ [59] a4 0x00000000 0 0 25 5 0 0 [60] m 0x00000038 2 1 0x6b 0x0000 main [61] a4 0x0000000c 0 0 17 10 0 0 [62] m 0x00000038 2 1 0x02 0x0000 main [63] a4 0x0000003c 0 0 2 10 0 0 [64] m 0x00000048 2 1 0x6b 0x0000 .data [65] a4 0x00000004 0 0 25 5 0 0 [66] m 0x0000004c 2 1 0x6b 0x0000 TOC [67] a4 0x00000000 0 0 17 15 0 0 [68] m 0x0000004c 3 1 0x6b 0x0000 _test.bss_ [69] a4 0x00000008 0 0 19 9 0 0 old as: [48] m 0x00000044 1 0 0x8f 0x0000 .bs ---------------------^ IS pointing to 68 = 0x44 [49] m 0x00000004 -2 0 0x85 0x0000 innerstat:V3 [50] m 0x00000000 1 0 0x90 0x0000 .es [51] m 0x00000010 1 1 0x64 0x0000 .eb [52] a1 0 1 0 0 0 [53] m 0x00000020 1 1 0x65 0x0000 .ef [54] a1 0 2 0 0 0 [55] m 0x00000044 1 0 0x8f 0x0000 .bs ---------------------^ [56] m 0x00000000 -2 0 0x85 0x0000 globstat:S3 [57] m 0x00000000 1 0 0x90 0x0000 .es [58] m 0x00000038 2 1 0x6b 0x0000 _test.rw_ [59] a4 0x00000000 0 0 25 5 0 0 [60] m 0x00000038 2 1 0x6b 0x0000 main [61] a4 0x0000000c 0 0 17 10 0 0 [62] m 0x00000038 2 1 0x02 0x0000 main [63] a4 0x0000003c 0 0 2 10 0 0 [64] m 0x00000048 2 1 0x6b 0x0000 .data [65] a4 0x00000004 0 0 25 5 0 0 [66] m 0x0000004c 2 1 0x6b 0x0000 TOC [67] a4 0x00000000 0 0 17 15 0 0 [68] m 0x0000004c 3 1 0x6b 0x0000 _test.bss_ [69] a4 0x00000008 0 0 19 9 0 0 Everything else is created in the object file (.bss .debug) AFAIK the _test.bss_ csect is an outcome of the .lcomm pseudo-op When adding a .csect _test.bss_[BS] the csect index in the toc is still 0. Even worse: i get a duplicate toc entry for _test.bss_ I could add a new csect before each .bs to make it linkable, but gdb doesn't find the stabs then... Btw: this as issue doesn't seem new: http://www.opensource.apple.com/source/cc/cc-798/cc/xcoffout.h see #define DBX_STATIC_BLOCK_START http://www.opensource.apple.com/source/gcc/gcc-934.3/gcc/README.RS6000 see AIX 4.3.0 assembler