From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 37043 invoked by alias); 12 Apr 2016 11:00:51 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 36958 invoked by uid 89); 12 Apr 2016 11:00:50 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_05,KAM_STOCKGEN,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=UD:string, sk:rootro, sk:root.ro, BFD_ASSERT X-HELO: mail-wm0-f44.google.com Received: from mail-wm0-f44.google.com (HELO mail-wm0-f44.google.com) (74.125.82.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 12 Apr 2016 11:00:36 +0000 Received: by mail-wm0-f44.google.com with SMTP id v188so122048271wme.1 for ; Tue, 12 Apr 2016 04:00:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=+O3eyYUP+D/eph3HnsIJbiKPLftuh91pGHlXwmL/61M=; b=i5REbB4WOLmX4D58MtNd3Rog88CpcQrfiFmfhQcqoC+KD56j2ACunky5sM5b+k81+i QPSLNH8qc3R5OAG2DvAKOFxoqTwpUgwWHsRjBpfYNep1e84t38Z6l+Rxf2nfHSFHvvOm P9q7JTtETXxgA8bs+C4LN6gYWUlMKmSpyaXvFl9SDt3gKZ5+DO7+wrdsL04SIfDo437u hWe/5BNDg6X02A1p7Vqq1a7uTM4RbzD0EZiVK80j7DU7bYI5S5fEzEZ1PhfuJHPLJSXE n2DJv8GW/05ILW6Syd3qVwGW2R+r3sSb9SYHWruboVcth7iqXT+87A0W4mbtp3AUKIzC KloQ== X-Gm-Message-State: AOPr4FXiN7RDnCfoB9ZJjcpa7svFFmkxh9GjXUwBvhxhFnzwqUATQItbTpxQYRkP/tfIvg== X-Received: by 10.194.66.34 with SMTP id c2mr2836789wjt.90.1460458833713; Tue, 12 Apr 2016 04:00:33 -0700 (PDT) Received: from localhost (host81-148-252-106.range81-148.btcentralplus.com. [81.148.252.106]) by smtp.gmail.com with ESMTPSA id j10sm32776032wjb.46.2016.04.12.04.00.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Apr 2016 04:00:33 -0700 (PDT) From: Andrew Burgess To: binutils@sourceware.org Cc: Claudiu.Zissulescu@synopsys.com, Cupertino.Miranda@synopsys.com, noamca@mellanox.com, Andrew Burgess Subject: [PATCHv2 2/3] bfd/arc: Rename enum entries to avoid conflicts Date: Tue, 12 Apr 2016 11:00:00 -0000 Message-Id: <8181b22162809916157ac2d6d38f50840371d3c5.1460458691.git.andrew.burgess@embecosm.com> In-Reply-To: References: In-Reply-To: References: <1460027127-1121-1-git-send-email-andrew.burgess@embecosm.com> X-IsSubscribed: yes X-SW-Source: 2016-04/txt/msg00177.txt.bz2 In bfd/elf32-arc.c an enum is created that contains entries with generic names like 'NONE' and 'OFF'. This has been fine for now, but I had a need to include opcode/arc.h into bfd/elf32-arc.c. Unfortunately opcode/arc.h includes a different enum with identical generic names. Given that changing the enum in the header file could mean wide-ranging changes, while changing the enum in the .c file is limited to only changing the one file, I've added a prefix to the enum in the .c file. This commit does not add the new include, that will come later. There should be no functional change with this commit. bfd/ChangeLog: * elf32-arc.c (tls_got_entries): Add 'TLS_GOT_' prefix to all entries. (elf_arc_relocate_section): Update enum uses. (elf_arc_check_relocs): Likewise. (elf_arc_finish_dynamic_symbol): Likewise. --- bfd/ChangeLog | 8 ++++++++ bfd/elf32-arc.c | 34 +++++++++++++++++----------------- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c index 323f65d..263effc 100644 --- a/bfd/elf32-arc.c +++ b/bfd/elf32-arc.c @@ -127,10 +127,10 @@ enum tls_type_e enum tls_got_entries { - NONE = 0, - MOD, - OFF, - MOD_AND_OFF + TLS_GOT_NONE = 0, + TLS_GOT_MOD, + TLS_GOT_OFF, + TLS_GOT_MOD_AND_OFF }; struct got_entry @@ -1401,7 +1401,7 @@ elf_arc_relocate_section (bfd * output_bfd, bfd_put_32 (output_bfd, sym_value - sec_vma, htab->sgot->contents + entry->offset - + (entry->existing_entries == MOD_AND_OFF ? 4 : 0)); + + (entry->existing_entries ==TLS_GOT_MOD_AND_OFF ? 4 : 0)); ARC_DEBUG ("arc_info: FIXED -> %s value = 0x%x " "@ 0x%x, for symbol %s\n", @@ -1409,7 +1409,7 @@ elf_arc_relocate_section (bfd * output_bfd, "GOT_TLS_IE"), sym_value - sec_vma, htab->sgot->contents + entry->offset - + (entry->existing_entries == MOD_AND_OFF ? 4 : 0), + + (entry->existing_entries == TLS_GOT_MOD_AND_OFF ? 4 : 0), h->root.root.string); entry->processed = TRUE; @@ -1806,7 +1806,7 @@ elf_arc_check_relocs (bfd * abfd, bfd_link_pic (info), NULL); new_got_entry_to_list (&(local_got_ents[r_symndx]), - GOT_NORMAL, offset, NONE); + GOT_NORMAL, offset, TLS_GOT_NONE); } } else @@ -1818,7 +1818,7 @@ elf_arc_check_relocs (bfd * abfd, bfd_vma offset = ADD_SYMBOL_REF_SEC_AND_RELOC (got, TRUE, h); new_got_entry_to_list (&h->got.glist, - GOT_NORMAL, offset, NONE); + GOT_NORMAL, offset, TLS_GOT_NONE); } } } @@ -1847,7 +1847,7 @@ elf_arc_check_relocs (bfd * abfd, if (type != GOT_UNKNOWN && !symbol_has_entry_of_type (*list, type)) { - enum tls_got_entries entries = NONE; + enum tls_got_entries entries = TLS_GOT_NONE; bfd_vma offset = ADD_SYMBOL_REF_SEC_AND_RELOC (got, TRUE, h); @@ -1855,11 +1855,11 @@ elf_arc_check_relocs (bfd * abfd, { bfd_vma ATTRIBUTE_UNUSED notneeded = ADD_SYMBOL_REF_SEC_AND_RELOC (got, TRUE, h); - entries = MOD_AND_OFF; + entries = TLS_GOT_MOD_AND_OFF; } - if (entries == NONE) - entries = OFF; + if (entries == TLS_GOT_NONE) + entries = TLS_GOT_OFF; new_got_entry_to_list (list, type, offset, entries); } @@ -2256,16 +2256,16 @@ elf_arc_finish_dynamic_symbol (bfd * output_bfd, } list->created_dyn_relocation = TRUE; } - else if (list->existing_entries != NONE) + else if (list->existing_entries != TLS_GOT_NONE) { struct elf_link_hash_table *htab = elf_hash_table (info); enum tls_got_entries e = list->existing_entries; BFD_ASSERT (list->type != GOT_TLS_GD - || list->existing_entries == MOD_AND_OFF); + || list->existing_entries == TLS_GOT_MOD_AND_OFF); bfd_vma dynindx = h->dynindx == -1 ? 0 : h->dynindx; - if (e == MOD_AND_OFF || e == MOD) + if (e == TLS_GOT_MOD_AND_OFF || e == TLS_GOT_MOD) { ADD_RELA (output_bfd, got, got_offset, dynindx, R_ARC_TLS_DTPMOD, 0); @@ -2277,7 +2277,7 @@ GOT_OFFSET = 0x%x, GOT_VMA = 0x%x, INDEX = %d, ADDEND = 0x%x\n", + htab->sgot->output_offset + got_offset, dynindx, 0); } - if (e == MOD_AND_OFF || e == OFF) + if (e == TLS_GOT_MOD_AND_OFF || e == TLS_GOT_OFF) { bfd_vma addend = 0; if (list->type == GOT_TLS_IE) @@ -2285,7 +2285,7 @@ GOT_OFFSET = 0x%x, GOT_VMA = 0x%x, INDEX = %d, ADDEND = 0x%x\n", htab->sgot->contents + got_offset); ADD_RELA (output_bfd, got, - got_offset + (e == MOD_AND_OFF ? 4 : 0), + got_offset + (e == TLS_GOT_MOD_AND_OFF ? 4 : 0), dynindx, (list->type == GOT_TLS_IE ? R_ARC_TLS_TPOFF : R_ARC_TLS_DTPOFF), -- 2.5.1