This is the mail archive of the binutils@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]

Re: [gold] PATCH: Add R_X86_64_PC32_BND and R_X86_64_PLT32_BND


On Mon, Nov 18, 2013 at 9:24 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Mon, Nov 18, 2013 at 9:15 AM, Ian Lance Taylor <iant@google.com> wrote:
>>
>> I would rather you did a small switch statement setting a local
>> variable rather than nesting ?: expressions.
>
> Like this?
>
>         {
>           const char *r_name;
>           switch (r_type)
>             {
>             case elfcpp::R_X86_64_32:
>               r_name = "R_X86_64_32";
>               break;
>             case elfcpp::R_X86_64_PC32:
>               r_name = "R_X86_64_PC32";
>               break;
>             case elfcpp::R_X86_64_PC32_BND:
>               r_name = "R_X86_64_PC32_BND";
>               break;
>             default:
>               gold_unreachable();
>               break;
>             }
>           object->error(_("requires dynamic %s reloc against '%s' "
>                           "which may overflow at runtime; recompile "
>                           "with -fPIC"),
>                         r_name, gsym->name());
>         }
>

Yes, looks good.

Thanks.

Ian


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