Issue Details (XML | Word | Printable)

Key: PCC-356
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Iain Hibbert
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
pcc

tls data section has wrong flags?

Created: 12/Jun/11 04:39 PM   Updated: 30/Jun/11 09:45 PM
Component/s: i386 target
Affects Version/s: None
Fix Version/s: None

File Attachments: 1. File tdata.diff (0.9 kB)

Environment: NetBSD/i386


 Description  « Hide
Hi, the following code

  __thread int foo = 1;
  __thread int bar;

when compiled with "pcc -c" produces warnings

  foo.s: Assembler messages:
  foo.s:8: Warning: ignoring changed section attributes for .tdata

this is on NetBSD at least, using

  GNU assembler version 2.19.1 (i486--netbsdelf) using BFD version (NetBSD Binutils nb1) 2.19.

I fixed it (as per attached tdata.diff) by adding "T" to the section flags similarly to what has
been done with amd64..

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Iain Hibbert added a comment - 25/Jun/11 08:16 PM
This was fixed with recent commits, except that a new issue was introduced.. compiling a
uninitialised __thread variable with -fPIC causes a NULL pointer dereference when printing
a string, making (at least here) the section directive to be "(null)"

% cat t.c
__thread int t;
% pcc -fPIC -S t.c
% cat t.s
        (null)
        .align 4
        .size t,4
t:
        .space 4
        .ident "PCC: pcc 1.1.0.DEVEL 20110625 for netbsd-i386"
%

Anders Magnusson added a comment - 30/Jun/11 09:45 PM
Requestor reports this bug is fixed.