public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* PATCH: PR ld/3191: Linker failed to handle DW_FORM_ref_addr properly
@ 2006-09-20  6:16 H. J. Lu
  2006-09-20 11:40 ` H. J. Lu
  2006-09-20 19:59 ` Jim Wilson
  0 siblings, 2 replies; 11+ messages in thread
From: H. J. Lu @ 2006-09-20  6:16 UTC (permalink / raw)
  To: binutils

DW_FORM_ref_addr is offset_size according to DWARF3 and gcc follows
DWARF3. This patch fixes

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


H.J.
--
2006-09-19  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/3191
	* dwarf2.c (read_attribute_value): Properly handle
	DW_FORM_ref_addr.

--- bfd/dwarf2.c.ref_addr	2006-05-02 03:01:56.000000000 -0700
+++ bfd/dwarf2.c	2006-09-19 21:26:37.000000000 -0700
@@ -562,11 +562,16 @@ read_attribute_value (struct attribute *
   switch (form)
     {
     case DW_FORM_addr:
-      /* FIXME: DWARF3 draft says DW_FORM_ref_addr is offset_size.  */
-    case DW_FORM_ref_addr:
       attr->u.val = read_address (unit, info_ptr);
       info_ptr += unit->addr_size;
       break;
+    case DW_FORM_ref_addr:
+      if (unit->offset_size == 4)
+	attr->u.val = read_4_bytes (abfd, info_ptr);
+      else
+	attr->u.val = read_8_bytes (abfd, info_ptr);
+      info_ptr += unit->offset_size;
+      break;
     case DW_FORM_block2:
       amt = sizeof (struct dwarf_block);
       blk = bfd_alloc (abfd, amt);

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2006-09-28  1:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-20  6:16 PATCH: PR ld/3191: Linker failed to handle DW_FORM_ref_addr properly H. J. Lu
2006-09-20 11:40 ` H. J. Lu
2006-09-20 14:48   ` Daniel Jacobowitz
2006-09-20 19:15   ` Jim Wilson
2006-09-20 22:32   ` H. J. Lu
2006-09-21  2:10     ` H. J. Lu
2006-09-21 16:23       ` H. J. Lu
2006-09-28  7:45         ` Jim Wilson
2006-09-28  9:08           ` H. J. Lu
2006-09-20 19:59 ` Jim Wilson
2006-09-20 20:02   ` H. J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).