[Bug ld/13491] New: SECREL32 relocation invalid with external symbol

2011-12-12 Thread venix1 at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=13491

 Bug #: 13491
   Summary: SECREL32 relocation invalid with external symbol
   Product: binutils
   Version: 2.23 (HEAD)
Status: NEW
  Severity: critical
  Priority: P2
 Component: ld
AssignedTo: unassig...@sourceware.org
ReportedBy: ven...@gmail.com
Classification: Unclassified


Created attachment 6102
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6102
Test case for secrel32

Attempting to use SECREL32 relocation for generating TLS offsets on Windows
works perfectly if the symbol is defined in the object file it is used.

However when the symbol is defined in different object file it generates the
offset against ".text".

The following lines of code appear in coff_i386_rtype_to_howto of
bfd/coff-i386.c and I believe should account for that.  But it doesn't and I
found it odd that h->type was used when similar tests used h->root.type.

if (h && (h->type == bfd_link_hash_defined
|| h->type == bfd_link_hash_defweak))
osect_vma = h->root.u.def.section->output_section->vma;

After changing from h->type to h->root.type the problem went away.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/13491] SECREL32 relocation invalid with external symbol

2011-12-12 Thread venix1 at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=13491

Daniel Green  changed:

   What|Removed |Added

 CC||venix1 at gmail dot com

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/13491] SECREL32 relocation invalid with external symbol

2011-12-12 Thread venix1 at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=13491

--- Comment #1 from Daniel Green  2011-12-12 20:22:57 
UTC ---
Created attachment 6103
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6103
Proposed changes.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/13491] SECREL32 relocation invalid with external symbol

2011-12-12 Thread venix1 at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=13491

Daniel Green  changed:

   What|Removed |Added

   Attachment #6102|0   |1
is obsolete||

--- Comment #2 from Daniel Green  2011-12-12 20:24:51 
UTC ---
Created attachment 6104
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6104
secrel32.s

Included wrong assembly file.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils