This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] ia64: use XOBNEW and XOBNEWVEC


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e5e27b0769acf1c864ac9e41544c0747d1058cd5

commit e5e27b0769acf1c864ac9e41544c0747d1058cd5
Author: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
Date:   Fri May 20 06:33:35 2016 -0400

    ia64: use XOBNEW and XOBNEWVEC
    
    gas/ChangeLog:
    
    2016-05-24  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
    
    	* config/tc-ia64.c (dot_rot): simplify allocations from obstacks.
    	(ia64_frob_label): Likewise.

Diff:
---
 gas/ChangeLog        | 5 +++++
 gas/config/tc-ia64.c | 8 ++++----
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/gas/ChangeLog b/gas/ChangeLog
index 41518df..a7f1a18 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,10 @@
 2016-05-24  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
 
+	* config/tc-ia64.c (dot_rot): simplify allocations from obstacks.
+	(ia64_frob_label): Likewise.
+
+2016-05-24  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
+
 	* config/tc-cr16.c (check_range): Make type of retval op_err.
 	* config/tc-crx.c: Likewise.
 
diff --git a/gas/config/tc-ia64.c b/gas/config/tc-ia64.c
index c0eb593..83ea813 100644
--- a/gas/config/tc-ia64.c
+++ b/gas/config/tc-ia64.c
@@ -4668,11 +4668,11 @@ dot_rot (int type)
 
       if (!*drpp)
 	{
-	  *drpp = obstack_alloc (&notes, sizeof (*dr));
+	  *drpp = XOBNEW (&notes, struct dynreg);
 	  memset (*drpp, 0, sizeof (*dr));
 	}
 
-      name = obstack_alloc (&notes, len + 1);
+      name = XOBNEWVEC (&notes, char, len + 1);
       memcpy (name, start, len);
       name[len] = '\0';
 
@@ -7765,7 +7765,7 @@ ia64_frob_label (struct symbol *sym)
      labels.  */
   if (defining_tag)
     {
-      fix = obstack_alloc (&notes, sizeof (*fix));
+      fix = XOBNEW (&notes, struct label_fix);
       fix->sym = sym;
       fix->next = CURR_SLOT.tag_fixups;
       fix->dw2_mark_labels = FALSE;
@@ -7777,7 +7777,7 @@ ia64_frob_label (struct symbol *sym)
   if (bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE)
     {
       md.last_text_seg = now_seg;
-      fix = obstack_alloc (&notes, sizeof (*fix));
+      fix = XOBNEW (&notes, struct label_fix);
       fix->sym = sym;
       fix->next = CURR_SLOT.label_fixups;
       fix->dw2_mark_labels = dwarf2_loc_mark_labels;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]