Re: [regressions in GCC/libjava testsuite] Re: Patch to make bfd compile with -Wc++-compat

Martin Thuresson <[email protected]>
Newsgroups gmane.comp.gcc.java.devel
Message-ID <[email protected]>
Here is a patch that fixes a bug introduced with my patch. Im sorry
for the first mistake.
I was unable to run make check on my mac laptop, but will do it on my
linux box in 30 min
or so.

Martin

2009-09-07  Martin Thuresson  <[email protected]>

	* binutils/addr2line.c (slurp_symtab): Fixed pointer bug.


On Wed, Sep 30, 2009 at 5:20 PM, Martin Thuresson <[email protected]> wrote:
> On Wed, Sep 30, 2009 at 5:04 PM, Alan Modra <[email protected]> wrote:
>> On Thu, Oct 01, 2009 at 09:18:35AM +0930, Alan Modra wrote:
>>> On Thu, Oct 01, 2009 at 01:23:33AM +0200, Matthias Klose wrote:
>>> > It's the one applied to the binutils subdirectory.
>>>
>>> It is probably the addr2line.c change.  Try this:
>>
>> That's not the right patch, but does identify the breakage..
>> bfd_read_minisymbols ought to take a void * param instead of void **,
>> I think.
>
> The issue in questions seems to be my patch from here:
> http://sourceware.org/ml/binutils/2009-09/msg00276.html
>
> I cant recall why my change stopped the -Wc++-error. Ill take
> a look and will submit a fix.
>
> Martin
>
>
> Excerpt:
>
> diff -u -u -p -r1.33 addr2line.c
> --- binutils/addr2line.c        2 Sep 2009 07:22:31 -0000       1.33
> +++ binutils/addr2line.c        9 Sep 2009 23:01:26 -0000
> @@ -102,13 +102,14 @@ slurp_symtab (bfd *abfd)
>  {
>   long symcount;
>   unsigned int size;
> +  void *minisyms = &syms;
>
>   if ((bfd_get_file_flags (abfd) & HAS_SYMS) == 0)
>     return;
>
> -  symcount = bfd_read_minisymbols (abfd, FALSE, (void *) &syms, &size);
> +  symcount = bfd_read_minisymbols (abfd, FALSE, &minisyms, &size);
>   if (symcount == 0)
> -    symcount = bfd_read_minisymbols (abfd, TRUE /* dynamic */, (void
> *) &syms, &size);
> +    symcount = bfd_read_minisymbols (abfd, TRUE /* dynamic */,
> &minisyms, &size);
>
>   if (symcount < 0)
>     bfd_fatal (bfd_get_filename (abfd));
>
foo.patch.txt (text/plain, 513 B)
Index: binutils/addr2line.c
===================================================================
RCS file: /cvs/src/src/binutils/addr2line.c,v
retrieving revision 1.34
diff -u -p -r1.34 addr2line.c
--- binutils/addr2line.c	10 Sep 2009 13:40:44 -0000	1.34
+++ binutils/addr2line.c	1 Oct 2009 00:38:32 -0000
@@ -102,7 +102,7 @@ slurp_symtab (bfd *abfd)
 {
   long symcount;
   unsigned int size;
-  void *minisyms = &syms;
+  void *minisyms = syms;
 
   if ((bfd_get_file_flags (abfd) & HAS_SYMS) == 0)
     return;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.