Re: [RFC] Passing MIPS debug hints between gcc and gdb

Fred Fish
2006-05-17T20:23:53Z

On Thursday 11 May 2006 02:57, Richard Sandiford wrote:
> Using empty sections was always a hack, to be honest (modelled on the
> old .gcc_compiled_v3 thing, whatever it was called). I suppose we
> should be using note sections really.

Wouldn't that be ELF specific, as well as requiring the linker to
merge hint strings? I'm a little unclear on just what capabilities
the current linker has to merge section contents so that "hint
strings" put into a note section wouldn't be duplicated in the final
linked output, one for each compilation unit.

How about just creating common symbols, which will be merged. That
takes up less space than a section in the executable file, but does
contribute something to the size of of the loaded uninitialized
segment. I.E. if I add the following to mips_file_start():

{
char buf[32];
sprintf (buf, "__%s", abi_string);
mips_declare_common_object (asm_out_file, buf, "\n\t.comm\t", 4, 0, true);
}

cc1 then generates:

.comm __abiO64,4,0

in each output. The linker should then merge all these into a single
symbol in the output, which gdb could easily search for.

-Fred