This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] ia64: use XOBNEW and XOBNEWVEC
- From: tbsaunde+binutils at tbsaunde dot org
- To: binutils at sourceware dot org
- Cc: Trevor Saunders <tbsaunde+binutils at tbsaunde dot org>
- Date: Mon, 23 May 2016 04:33:56 -0400
- Subject: [PATCH] ia64: use XOBNEW and XOBNEWVEC
- Authentication-results: sourceware.org; auth=none
From: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
Hi,
built and regtested cross to ia64-elf, ok?
Trev
gas/ChangeLog:
2016-05-23 Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
* config/tc-ia64.c (dot_rot): simplify allocations from obstacks.
(ia64_frob_label): Likewise.
---
gas/config/tc-ia64.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
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 (¬es, sizeof (*dr));
+ *drpp = XOBNEW (¬es, struct dynreg);
memset (*drpp, 0, sizeof (*dr));
}
- name = obstack_alloc (¬es, len + 1);
+ name = XOBNEWVEC (¬es, 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 (¬es, sizeof (*fix));
+ fix = XOBNEW (¬es, 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 (¬es, sizeof (*fix));
+ fix = XOBNEW (¬es, struct label_fix);
fix->sym = sym;
fix->next = CURR_SLOT.label_fixups;
fix->dw2_mark_labels = dwarf2_loc_mark_labels;
--
2.8.1