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

Daniel Jacobowitz
2005-04-30T18:33:07Z

On Sat, Apr 30, 2005 at 05:06:06PM +0800, Wu Zhou wrote:
> Hi, Paul and Daniel
>
> I made some little modification to the comments on the xlc-specific
> options and also added a short text in changelog to explain why they are
> necessary. I wish that I could make myself understood. But if there are
> any errors or confusion, please feel free to let me know. Thanks.

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.

> ! if [test_compiler_info "xlc-*"] {
> !
> ! # static variable static_var_1 & static_var_2 are not used
> anywhere, IBM's
> ! # xlc compiler optimizes them out by default, "-qdbxextra" adds
> them back
> !
> ! lappend lib_opts "additional_flags=-qdbxextra"
> !
> ! # IBM's xlc compiler doesn't add static variables to the symtab by
> default,
> ! # so there is no static_var_1 & static_var_2 in the output of
> "maint print
> ! # msymbols ${msymfile}", "-qstatsym" causes them to be added.
> !
> ! lappend lib_opts "additional_flags=-qstatsym"
> !
> }

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.

--
Daniel Jacobowitz
CodeSourcery, LLC