This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[RFA] Fix broken .linkonce
- From: Christopher Faylor <me at cgf dot cx>
- To: binutils at sourceware dot org
- Date: Sat, 3 Jul 2004 23:11:37 -0400
- Subject: [RFA] Fix broken .linkonce
H.J. Lu's 2004-05-11 change to subsegs.c caused .linkonce symbols to be treated as
undeclared, at least for PE.
Does the below patch make sense?
cgf
2004-07-03 Christopher Faylor <cgf@timesys.com>
* subsegs.c (section_symbol): Don't create a new segment when existing
segment is undefined.
Index: subsegs.c
===================================================================
RCS file: /cvs/src/src/gas/subsegs.c,v
retrieving revision 1.16
diff -u -p -r1.16 subsegs.c
--- subsegs.c 11 May 2004 15:53:47 -0000 1.16
+++ subsegs.c 4 Jul 2004 03:02:42 -0000
@@ -523,18 +523,16 @@ section_symbol (segT sec)
}
else
{
+ segT *seg;
s = symbol_find_base (sec->symbol->name, 0);
/* We have to make sure it is the right symbol when we
have multiple sections with the same section name. */
- if (s == NULL || S_GET_SEGMENT (s) != sec)
+ if (s == NULL || ((seg = S_GET_SEGMENT (s)) != sec && seg != undefined_section))
s = symbol_new (sec->symbol->name, sec, 0, &zero_address_frag);
else
{
- if (S_GET_SEGMENT (s) == undefined_section)
- {
- S_SET_SEGMENT (s, sec);
- symbol_set_frag (s, &zero_address_frag);
- }
+ S_SET_SEGMENT (s, sec);
+ symbol_set_frag (s, &zero_address_frag);
}
}