Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Fix hash table mixup in bfd_simple_get_relocated_section_content
@ 2003-09-17 16:04 Andreas Schwab
  2003-09-17 16:09 ` Daniel Jacobowitz
  0 siblings, 1 reply; 7+ messages in thread
From: Andreas Schwab @ 2003-09-17 16:04 UTC (permalink / raw)
  To: gdb-patches

bfd_simple_get_relocated_section_content uses the generic linker
interface, so it should also use the generic_link_hash_table.

Andreas.

2003-09-17  Andreas Schwab  <schwab@suse.de>

	* simple.c (bfd_simple_get_relocated_section_contents): Use
	_bfd_generic_link_hash_table_create instead of
	bfd_link_hash_table_create.

--- bfd/simple.c.~1.9.~	2003-06-05 16:07:52.000000000 +0200
+++ bfd/simple.c	2003-09-17 17:32:49.000000000 +0200
@@ -198,7 +198,7 @@ bfd_simple_get_relocated_section_content
   memset (&link_info, 0, sizeof (link_info));
   link_info.input_bfds = abfd;
 
-  link_info.hash = bfd_link_hash_table_create (abfd);
+  link_info.hash = _bfd_generic_link_hash_table_create (abfd);
   link_info.callbacks = &callbacks;
   callbacks.warning = simple_dummy_warning;
   callbacks.undefined_symbol = simple_dummy_undefined_symbol;

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Fix hash table mixup in bfd_simple_get_relocated_section_content
  2003-09-17 16:04 Fix hash table mixup in bfd_simple_get_relocated_section_content Andreas Schwab
@ 2003-09-17 16:09 ` Daniel Jacobowitz
  2003-09-17 16:46   ` Andreas Schwab
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2003-09-17 16:09 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: gdb-patches

On Wed, Sep 17, 2003 at 06:04:05PM +0200, Andreas Schwab wrote:
> bfd_simple_get_relocated_section_content uses the generic linker
> interface, so it should also use the generic_link_hash_table.

Hmm, this seems right to me.

> 2003-09-17  Andreas Schwab  <schwab@suse.de>
> 
> 	* simple.c (bfd_simple_get_relocated_section_contents): Use
> 	_bfd_generic_link_hash_table_create instead of
> 	bfd_link_hash_table_create.
> 
> --- bfd/simple.c.~1.9.~	2003-06-05 16:07:52.000000000 +0200
> +++ bfd/simple.c	2003-09-17 17:32:49.000000000 +0200
> @@ -198,7 +198,7 @@ bfd_simple_get_relocated_section_content
>    memset (&link_info, 0, sizeof (link_info));
>    link_info.input_bfds = abfd;
>  
> -  link_info.hash = bfd_link_hash_table_create (abfd);
> +  link_info.hash = _bfd_generic_link_hash_table_create (abfd);
>    link_info.callbacks = &callbacks;
>    callbacks.warning = simple_dummy_warning;
>    callbacks.undefined_symbol = simple_dummy_undefined_symbol;
> 
> -- 
> Andreas Schwab, SuSE Labs, schwab@suse.de
> SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
> Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
> "And now for something completely different."
> 

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Fix hash table mixup in bfd_simple_get_relocated_section_content
  2003-09-17 16:09 ` Daniel Jacobowitz
@ 2003-09-17 16:46   ` Andreas Schwab
  2003-09-17 18:26     ` Andrew Cagney
  0 siblings, 1 reply; 7+ messages in thread
From: Andreas Schwab @ 2003-09-17 16:46 UTC (permalink / raw)
  To: gdb-patches

Daniel Jacobowitz <drow@mvista.com> writes:

> On Wed, Sep 17, 2003 at 06:04:05PM +0200, Andreas Schwab wrote:
>> bfd_simple_get_relocated_section_content uses the generic linker
>> interface, so it should also use the generic_link_hash_table.
>
> Hmm, this seems right to me.

Posted now to binutils@ where it belongs, but I think this should be
added to gdb-6.0 because it also affects add-symbol.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Fix hash table mixup in bfd_simple_get_relocated_section_content
  2003-09-17 16:46   ` Andreas Schwab
@ 2003-09-17 18:26     ` Andrew Cagney
  2003-09-17 19:41       ` Andreas Schwab
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Cagney @ 2003-09-17 18:26 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: gdb-patches

> Daniel Jacobowitz <drow@mvista.com> writes:
> 
> 
>> On Wed, Sep 17, 2003 at 06:04:05PM +0200, Andreas Schwab wrote:
> 
>>> bfd_simple_get_relocated_section_content uses the generic linker
>>> interface, so it should also use the generic_link_hash_table.
> 
>>
>> Hmm, this seems right to me.
> 
> 
> Posted now to binutils@ where it belongs, but I think this should be
> added to gdb-6.0 because it also affects add-symbol.

Grrrr :-)

What's the damage without it?

Andrew



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Fix hash table mixup in bfd_simple_get_relocated_section_content
  2003-09-17 18:26     ` Andrew Cagney
@ 2003-09-17 19:41       ` Andreas Schwab
  2003-09-17 20:42         ` Andrew Cagney
  0 siblings, 1 reply; 7+ messages in thread
From: Andreas Schwab @ 2003-09-17 19:41 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

Andrew Cagney <ac131313@redhat.com> writes:

>> Daniel Jacobowitz <drow@mvista.com> writes:
>> 
>>> On Wed, Sep 17, 2003 at 06:04:05PM +0200, Andreas Schwab wrote:
>> 
>>>> bfd_simple_get_relocated_section_content uses the generic linker
>>>> interface, so it should also use the generic_link_hash_table.
>> 
>>>
>>> Hmm, this seems right to me.
>> Posted now to binutils@ where it belongs, but I think this should be
>> added to gdb-6.0 because it also affects add-symbol.
>
> Grrrr :-)
>
> What's the damage without it?

You can get random crashes in generic_link_add_symbol_list because
_bfd_generic_link_add_one_symbol hands out a bfd_link_hash_entry, but a
generic_link_hash_entry is expected, and h->sym remains uninitialized.
The specific case where it happend was gdb debugging a user mode linux
process, and applying add-symbol to a kernel module.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Fix hash table mixup in bfd_simple_get_relocated_section_content
  2003-09-17 19:41       ` Andreas Schwab
@ 2003-09-17 20:42         ` Andrew Cagney
  2003-09-18  1:57           ` Alan Modra
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Cagney @ 2003-09-17 20:42 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: gdb-patches, Nick Clifton, Alan Modra

> Andrew Cagney <ac131313@redhat.com> writes:
> 
> 
>>> Daniel Jacobowitz <drow@mvista.com> writes:
>>> 
> 
>>>> On Wed, Sep 17, 2003 at 06:04:05PM +0200, Andreas Schwab wrote:
> 
>>> 
> 
>>>>> bfd_simple_get_relocated_section_content uses the generic linker
>>>>> interface, so it should also use the generic_link_hash_table.
> 
>>> 
> 
>>>>
>>>> Hmm, this seems right to me.
> 
>>> Posted now to binutils@ where it belongs, but I think this should be
>>> added to gdb-6.0 because it also affects add-symbol.
> 
>>
>> Grrrr :-)
>>
>> What's the damage without it?
> 
> 
> You can get random crashes in generic_link_add_symbol_list because
> _bfd_generic_link_add_one_symbol hands out a bfd_link_hash_entry, but a
> generic_link_hash_entry is expected, and h->sym remains uninitialized.
> The specific case where it happend was gdb debugging a user mode linux
> process, and applying add-symbol to a kernel module.

If you can extract a "safe for GDB's branch" from Nick or Alan then it's 
approved.

Andrew



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Fix hash table mixup in bfd_simple_get_relocated_section_content
  2003-09-17 20:42         ` Andrew Cagney
@ 2003-09-18  1:57           ` Alan Modra
  0 siblings, 0 replies; 7+ messages in thread
From: Alan Modra @ 2003-09-18  1:57 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: Andreas Schwab, gdb-patches, Nick Clifton

On Wed, Sep 17, 2003 at 04:42:05PM -0400, Andrew Cagney wrote:
> If you can extract a "safe for GDB's branch" from Nick or Alan then it's 
> approved.

Yeah, should be good.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-09-18  1:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-17 16:04 Fix hash table mixup in bfd_simple_get_relocated_section_content Andreas Schwab
2003-09-17 16:09 ` Daniel Jacobowitz
2003-09-17 16:46   ` Andreas Schwab
2003-09-17 18:26     ` Andrew Cagney
2003-09-17 19:41       ` Andreas Schwab
2003-09-17 20:42         ` Andrew Cagney
2003-09-18  1:57           ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox