From owner-svn-src-all@FreeBSD.ORG Thu Jul 31 15:43:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 90E93518; Thu, 31 Jul 2014 15:43:52 +0000 (UTC) Received: from mail-ig0-x22e.google.com (mail-ig0-x22e.google.com [IPv6:2607:f8b0:4001:c05::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 39ECB20B0; Thu, 31 Jul 2014 15:43:52 +0000 (UTC) Received: by mail-ig0-f174.google.com with SMTP id c1so9663942igq.13 for ; Thu, 31 Jul 2014 08:43:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=foNpRrmk0X0Rkk8zm+VDqMpzpbB40CcnebGJ9CM7zAQ=; b=03tenDxvtFPpDo6oyPfanymBeMOJmDUvobLP4+sdPRTd55juYOAt5NJyShyfdxsnC2 Z60FDXR9srkkCrsE2SkVjZpNn4YNdeCziOST3xyjMdGaEeeS+HLIUz787zox5DNGMugg HCI9zoUfaFWmcaldfSpRrn7zYDjApTlHScHvSghPrOFa8+aKvzURgEibOWq2qvvTVpZf BslyFVY96DoedsPtMVzgmRX2FLVQlhl5BbW2Bu78bXG9hk+b8HTAWDiEE/04SHTYkSi0 JWQCyN2g+HKWwOwXyc7NBEDHIg+50ABoxAMQofHsdDz+QluzEPZZeYxEMo6PXFlafmrH uZ+g== MIME-Version: 1.0 X-Received: by 10.50.134.232 with SMTP id pn8mr67549151igb.11.1406821430037; Thu, 31 Jul 2014 08:43:50 -0700 (PDT) Sender: carpeddiem@gmail.com Received: by 10.107.131.38 with HTTP; Thu, 31 Jul 2014 08:43:49 -0700 (PDT) In-Reply-To: <1406404842.56408.26.camel@revolution.hippie.lan> References: <201407261944.s6QJikAI024004@svn.freebsd.org> <1406404842.56408.26.camel@revolution.hippie.lan> Date: Thu, 31 Jul 2014 11:43:49 -0400 X-Google-Sender-Auth: AQCtPWpHEhspetq_zRQ4Z0Ursxk Message-ID: Subject: Re: svn commit: r269143 - head/usr.bin/elfdump From: Ed Maste To: Ian Lepore Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Andreas Tobler X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jul 2014 15:43:52 -0000 On 26 July 2014 16:00, Ian Lepore wrote: >> + case EM_ARM: >> + switch (sht) { >> + case 0x70000001: return "SHT_ARM_EXIDX"; >> + case 0x70000002: return "SHT_ARM_PREEMPTMAP"; >> + case 0x70000003: return "SHT_ARM_ATTRIBUTES"; >> + case 0x70000004: return "SHT_ARM_DEBUGOVERLAY"; >> + case 0x70000005: return "SHT_ARM_OVERLAYSECTION"; >> + } >> + break; >> case EM_MIPS: >> switch (sht) { >> case 0x7000000d: return "SHT_MIPS_OPTIONS"; >> > > I'm curious why this code is all full of 0xnnnnnnnn numbers when there > are named constants defined for all this stuff. I don't think there's a good reason for it. It seems to have just evolved that way after sh_types() and d_tags() switched from an array of names, when the first non-contiguous entries were added. In r269338 I've replaced the constants with #defines that exist.