Re: [patch] update gdb.base/shreloc.exp to use new shared library infrastructure

Wu Zhou
2005-05-01T04:19:22Z

Quoting Daniel Jacobowitz <drow@false.org>:

> This does not be long in the changelog, only in the comments. The
> ChangeLog for this patch should look like:
>
> 2005-04-29 Paul Gilliam <pgilliam@us.ibm.com>
> Wu Zhou <woodzltc@cn.ibm.com>
>
> * gdb.base/shreloc.exp: Use gdb_compile_shlib. Add support for
> IBM's xlc compiler.
>
> If you're going to post patches to this list, please find a mail client
> which does not mangle line wrapping; the patch as I received it is hard
> to read and can not be applied.

Sorry, wish that this time it is ok.

> OK, now I understand why you needed the options. We will need
> -qstatsym; here's a better description:
>
> # IBM's xlc compiler does not add static variables to the ELFe symbol
> # table by default. We need this option to make the variables show
> # up in "maint print msymbols".
>
> Can we fix the testcase instead of adding -qdbxextra, by making the
> variable referenced? Other compilers do the same optimization, and
> some of them don't have a handy option to preserve the variable.
>

Is it ok to change the following lines in shreloc1.c/shreloc2.c from:

ATTRIBUTES void fn_1 (int unused) { }
ATTRIBUTES void fn_2 (int unused) { }

to:

ATTRIBUTES void fn_1 (int refered) { static_var_1 = refered; }
ATTRIBUTES void fn_2 (int refered) { static_var_2 = refered; }

Please comments. Thanks.

Cheers
- Wu Zhou