http://sourceware.org/ml/binutils/2006-07/msg00208.html breaks --sort-section name: [hjl@gnu-13 sort-1]$ cat x.c void foo () { } [hjl@gnu-13 sort-1]$ cat sort.t SECTIONS { .text : { *(.text .text.*) } /DISCARD/ : { *(.*) } } [hjl@gnu-13 sort-1]$ gcc -c x.c [hjl@gnu-13 sort-1]$ ./ld x.o --sort-section name -T sort.t Segmentation fault
Created attachment 1213 [details] Check for a tree node with no section specified
Hi H.J. I am probably wrong, but this looks like a simple case of a missing check for a NULL pointer. The uploaded patch for example allows your test case to link successfully. What do you think ? Cheers Nick
I think it is wrong. The problem is handler_data [1] is used for 2 things, wildcard first. And then it was treated as tree later. I added 2 new tests today. I think one of them may fail with your patch. I posted a patch at http://sourceware.org/ml/binutils/2006-08/msg00080.html
Subject: Re: --sort-section name is brorken Hi H.J. > I think it is wrong. The problem is handler_data [1] is used for 2 things, > wildcard first. And then it was treated as tree later. I added 2 new tests > today. I think one of them may fail with your patch. I posted a patch at > > http://sourceware.org/ml/binutils/2006-08/msg00080.html Ah - right - please consider that patch approved. Cheers Nick
Fixed.