public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Christian Eggers <ceggers@gmx.de>
To: binutils@sourceware.org
Cc: Christian Eggers <ceggers@gmx.de>
Subject: [PATCH 5/7] [gas] dwarf2: Use octets for .debug_string offsets
Date: Sun, 10 Mar 2019 18:22:00 -0000	[thread overview]
Message-ID: <20190310182158.23705-6-ceggers@gmx.de> (raw)
In-Reply-To: <20190310182158.23705-1-ceggers@gmx.de>

Like other dwarf2 offsets, also the string offsets in the .debug_info
section which points into the .debug_str section must be expressed in
octets instead of bytes.

This change should not affect existing targets as all targets currently
using DWARF2 have 8 bit per byte.

Signed-off-by: Christian Eggers <ceggers@gmx.de>
---
 gas/ChangeLog   | 5 +++++
 gas/dwarf2dbg.c | 6 +++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/gas/ChangeLog b/gas/ChangeLog
index 4cb2702ab2..2d7dabc299 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2019-03-10  Christian Eggers  <ceggers@gmx.de>
+
+	* dwarf2dbg.c: Use octets for .debug_string pointers.
+	(out_debug_str): symbol_temp_new_now() --> symbol_temp_new_now_octets()
+
 2019-03-10  Christian Eggers  <ceggers@gmx.de>
 
 	* dwarf2dbg.c: Use octets for .debug_line prologue.
diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c
index 896a8f125a..d469138576 100644
--- a/gas/dwarf2dbg.c
+++ b/gas/dwarf2dbg.c
@@ -2103,7 +2103,7 @@ out_debug_str (segT str_seg, symbolS **name_sym, symbolS **comp_dir_sym,
      on the command line, so assume files[1] is the main input file.
      We're not supposed to get called unless at least one line number
      entry was emitted, so this should always be defined.  */
-  *name_sym = symbol_temp_new_now ();
+  *name_sym = symbol_temp_new_now_octets ();
   if (files_in_use == 0)
     abort ();
   if (files[1].dir)
@@ -2125,14 +2125,14 @@ out_debug_str (segT str_seg, symbolS **name_sym, symbolS **comp_dir_sym,
   memcpy (p, files[1].filename, len);
 
   /* DW_AT_comp_dir */
-  *comp_dir_sym = symbol_temp_new_now ();
+  *comp_dir_sym = symbol_temp_new_now_octets ();
   comp_dir = remap_debug_filename (getpwd ());
   len = strlen (comp_dir) + 1;
   p = frag_more (len);
   memcpy (p, comp_dir, len);
 
   /* DW_AT_producer */
-  *producer_sym = symbol_temp_new_now ();
+  *producer_sym = symbol_temp_new_now_octets ();
   sprintf (producer, "GNU AS %s", VERSION);
   len = strlen (producer) + 1;
   p = frag_more (len);
-- 
2.16.4

  parent reply	other threads:[~2019-03-10 18:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-10 18:22 [PATCH 0/7] gas: Fixes for DWARF2 debug info with OCTETS_PER_BYTE>1 Christian Eggers
2019-03-10 18:22 ` [PATCH 3/7] [gas] dwarf2: Use octets for dwarf2 headers Christian Eggers
2019-03-10 18:22 ` [PATCH 1/7] [gas] dwarf2: Fix calculation of line info offset Christian Eggers
2019-03-10 18:22 ` [PATCH 6/7] [gas] dwarf2: Pad size of .debug_line section Christian Eggers
2019-03-10 18:22 ` [PATCH 7/7] [gas] dwarf2: Align relocation within " Christian Eggers
2019-03-10 18:22 ` [PATCH 4/7] [gas] dwarf2: Use octets for .debug_line prologue Christian Eggers
2019-03-10 18:22 ` Christian Eggers [this message]
2019-03-10 18:27 ` [PATCH 2/7] [gas] Allow to create symbols with octets value Christian Eggers
2019-03-13  4:49 ` [PATCH 0/7] gas: Fixes for DWARF2 debug info with OCTETS_PER_BYTE>1 Alan Modra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190310182158.23705-6-ceggers@gmx.de \
    --to=ceggers@gmx.de \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).