Bug 11486 - unitialized memory written in .TOC.@tocbase
Summary: unitialized memory written in .TOC.@tocbase
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: 2.20
: P2 normal
Target Milestone: ---
Assignee: Alan Modra
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-10 12:14 UTC by Marcus Meissner
Modified: 2010-04-10 14:13 UTC (History)
1 user (show)

See Also:
Host: powerpc-unknown-linux-gnu
Target: powerpc-unknown-linux-gnu
Build: powerpc-unknown-linux-gnu
Last reconfirmed: 2010-04-10 14:00:50


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcus Meissner 2010-04-10 12:14:15 UTC
the testsuite fails on powerpc-linux (and powerpc64-linux) if MALLOC_PERTURB_ 
is set.

/usr/src/packages/BUILD/binutils-2.20.0/build-dir/ld/../gas/as-new   -o 
tlslib.o -a64 /usr/src/packages/BUILD/binutils-2.20.0/ld/testsuite/ld-powerpc/tlslib.s --warn -a


GAS 
LISTING /usr/src/packages/BUILD/binutils-2.20.0/ld/testsuite/ld-powerpc/tlslib.s                    
page 1


   1                            .global __tls_get_addr,__tls_get_addr_opt,gd,ld
   2                            .type __tls_get_addr,@function
   3                            .type __tls_get_addr_opt,@function
   4              
   5                            .section ".opd","aw",@progbits
   6                    __tls_get_addr:
   7                    __tls_get_addr_opt:
   8                            .align 3
   9 0000 00000000              .quad   .L.__tls_get_addr
   9      00000000 
  10 0008 BEBEBEBE              .quad   .TOC.@tocbase
  10      BEBEBEBE 
  11 0010 00000000              .quad   0
  11      00000000 
  12              
  13                            .section ".tbss","awT",@nobits
  14                            .align 3
  15 0000 00000000      gd:     .space 8
  15      00000000 
  16              
  17                            .section ".tdata","awT",@progbits
  18                            .align 2
  19 0000 00C0FFEE      ld:     .long 0xc0ffee
  20              
  21                            .text
  22                    .L.__tls_get_addr:
  23 0000 4E800020              blr
  24                            .size __tls_get_addr,. - .L.__tls_get_addr
GAS 
LISTING /usr/src/packages/BUILD/binutils-2.20.0/ld/testsuite/ld-powerpc/tlslib.s                    
page 2


DEFINED SYMBOLS
/usr/src/packages/BUILD/binutils-2.20.0/ld/testsuite/ld-powerpc/tlslib.s:6      .opd:0000000000000000 
__tls_get_addr
/usr/src/packages/BUILD/binutils-2.20.0/ld/testsuite/ld-powerpc/tlslib.s:7      .opd:0000000000000000 
__tls_get_addr_opt
/usr/src/packages/BUILD/binutils-2.20.0/ld/testsuite/ld-powerpc/tlslib.s:15     .tbss:0000000000000000 
gd
/usr/src/packages/BUILD/binutils-2.20.0/ld/testsuite/ld-powerpc/tlslib.s:19     .tdata:0000000000000000 
ld

NO UNDEFINED SYMBOLS


The BEBEBEBE is from MALLOC_PERTURB_=65
Comment 1 Marcus Meissner 2010-04-10 12:15:12 UTC
Instead of BEBEBEBE the testsuite (and myself :) expect 0000000...
Comment 2 Sourceware Commits 2010-04-10 14:13:12 UTC
Subject: Bug 11486

CVSROOT:	/cvs/src
Module name:	src
Changes by:	amodra@sourceware.org	2010-04-10 14:12:57

Modified files:
	gas            : ChangeLog 
	gas/config     : tc-ppc.c 

Log message:
	PR gas/11486
	* config/tc-ppc.c (ppc_elf_cons): Clear frag contents.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/ChangeLog.diff?cvsroot=src&r1=1.4128&r2=1.4129
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/config/tc-ppc.c.diff?cvsroot=src&r1=1.164&r2=1.165

Comment 3 Alan Modra 2010-04-10 14:13:40 UTC
Fixed.