Bug 13593 - nm segfault print_size_symbole ()
Summary: nm segfault print_size_symbole ()
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.22
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-13 13:30 UTC by nicolas.vilmain
Modified: 2012-01-16 08:44 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nicolas.vilmain 2012-01-13 13:30:37 UTC
if set --size-sort and --no-sort together, in function print_size_symbole ()
the variable struct size_sym *symsizes == NULL and segfault at:
sym = bfd_minisymbol_to_symbol (abfd, is_dynamic, from->minisym, store);

mini-patch
1664a1665,1667
>   if (no_sort && sort_by_size)
>     sort_by_size = 0;
>
Comment 1 Sourceware Commits 2012-01-16 08:43:23 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	amodra@sourceware.org	2012-01-16 08:43:20

Modified files:
	binutils       : ChangeLog nm.c 

Log message:
	PR binutils/13593
	* nm.c (OPTION_SIZE_SORT): Define.
	(long_options): Don't set no_sort, sort_numerically or
	sort_by_size directly.
	(main): Instead set the flags here, making them mutually exclusive.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/binutils/ChangeLog.diff?cvsroot=src&r1=1.1868&r2=1.1869
http://sourceware.org/cgi-bin/cvsweb.cgi/src/binutils/nm.c.diff?cvsroot=src&r1=1.68&r2=1.69
Comment 2 Alan Modra 2012-01-16 08:44:42 UTC
fixed mainline