Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Jul 2014 11:43:49 -0400
From:      Ed Maste <emaste@freebsd.org>
To:        Ian Lepore <ian@freebsd.org>
Cc:        "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "src-committers@freebsd.org" <src-committers@freebsd.org>, Andreas Tobler <andreast@freebsd.org>
Subject:   Re: svn commit: r269143 - head/usr.bin/elfdump
Message-ID:  <CAPyFy2CB6chgR4GUnRLOZ-qB=6K2e2VB=WZ1UqK=JrPk-Vs1qA@mail.gmail.com>
In-Reply-To: <1406404842.56408.26.camel@revolution.hippie.lan>
References:  <201407261944.s6QJikAI024004@svn.freebsd.org> <1406404842.56408.26.camel@revolution.hippie.lan>

next in thread | previous in thread | raw e-mail | index | archive | help
On 26 July 2014 16:00, Ian Lepore <ian@freebsd.org> 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPyFy2CB6chgR4GUnRLOZ-qB=6K2e2VB=WZ1UqK=JrPk-Vs1qA>