This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ld broken by bst patch


Hello,

Thanks for the patch to fix the BST failure on powerpc64-linux. In my tests here, these changes worked well on i386pe.

Sonal

Alan Modra wrote:
On powerpc64-linux, I get
FAIL: bootstrap
FAIL: bootstrap with strip
FAIL: bootstrap with --static
FAIL: bootstrap with --traditional-format
FAIL: bootstrap with --no-keep-memory
FAIL: bootstrap with --relax
FAIL: cdtest
FAIL: cdtest with -Ur
FAIL: Run normal libbar.so with libfoo.so
FAIL: Run protected libbar.so with libfoo.so
FAIL: Run hidden libbar.so with libfoo.so
FAIL: Run normal libbar.so with versioned libfoo.so
FAIL: Run protected libbar.so with versioned libfoo.so
FAIL: Run hidden libbar.so with versioned libfoo.so
FAIL: ld-scripts/empty-aligned

All segfaults in wild when dereferencing an invalid s->handler_data[0].
Cured like so.

	* ldlang.c (analyze_walk_wild_section_handler): Init handler_data
	earlier.

Index: ld/ldlang.c
===================================================================
RCS file: /cvs/src/src/ld/ldlang.c,v
retrieving revision 1.227
diff -u -p -r1.227 ldlang.c
--- ld/ldlang.c 23 Jul 2006 15:32:08 -0000 1.227
+++ ld/ldlang.c 25 Jul 2006 14:35:44 -0000
@@ -670,6 +670,10 @@ analyze_walk_wild_section_handler (lang_
int data_counter;
ptr->walk_wild_section_handler = walk_wild_section_general;
+ ptr->handler_data[0] = NULL;
+ ptr->handler_data[1] = NULL;
+ ptr->handler_data[2] = NULL;
+ ptr->handler_data[3] = NULL;
/* Count how many wildcard_specs there are, and how many of those
actually use wildcards in the name. Also, bail out if any of the
@@ -735,10 +739,6 @@ analyze_walk_wild_section_handler (lang_
given order, because we've already determined that no section
will match more than one spec. */
data_counter = 0;
- ptr->handler_data[0] = NULL;
- ptr->handler_data[1] = NULL;
- ptr->handler_data[2] = NULL;
- ptr->handler_data[3] = NULL;
for (sec = ptr->section_list; sec != NULL; sec = sec->next)
if (!wildcardp (sec->spec.name))
ptr->handler_data[data_counter++] = sec;





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]