[GOLD] powerpc64 ODR violation check

Ian Lance Taylor iant@google.com
Wed Mar 6 14:33:00 GMT 2013


On Wed, Mar 6, 2013 at 5:23 AM, Alan Modra <amodra@gmail.com> wrote:
>
>         * gold.cc (queue_middle_tasks): Move detect_odr_violations..
>         * layout.cc (Layout_task_runner::run): ..to here.
>         * symtab.h (struct Symbol_location): Extract from..
>         (class Symbol_table): ..here.
>         * symtab.cc (Symbol_table::linenos_from_loc): Invoke func_desc_lookup.
>         * target.h (class Target): Add has_func_descriptors,
>         func_desc_lookup and do_func_desc_lookup functions.
>         (class Sized_target): Add do_func_desc_lookup function.
>         (Target::Target_info): Add has_func_descriptors bool.
>         * powerpc.cc (class Powerpc_dynobj): New.
>         (Target_powerpc::do_func_desc_loopkup): New function.
>         (powerpc_info): Update.
>         (Powerpc_dynobj::read_dyn_opd): New stub.
>         (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
>         * arm.cc, * i386.cc, * sparc.cc, * tilegx.cc, * x86_64.cc,
>         * testsuite/testfile.cc: Update Target_info initialization.

> +struct Symbol_location
> +{

Please add a comment for the struct declaration.

>    std::vector<std::string> result;
> +  const Symbol_location* code_loc = NULL;
> +  if (parameters->target().has_func_descriptors())
> +    code_loc = parameters->target().func_desc_lookup(&loc);
> +  if (code_loc == NULL)
> +    code_loc = &loc;

Why bother with has_func_descriptors?  Also I don't see a need for
allocation here.  How about

    Symbol_location tloc;
    parameters->target().function_location(loc, &tloc);
    // Now use tloc instead of loc.

And the default definition of function_location is

    void do_function_location(const Symbol_location& loc, Symbol_location* tloc)
    {
        *tloc = loc;
    }

Ian



More information about the Binutils mailing list