Bug 1321 - strip/objcopy don't handle SHF_LINK_ORDER correctly
Summary: strip/objcopy don't handle SHF_LINK_ORDER correctly
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-09 19:43 UTC by H.J. Lu
Modified: 2005-09-29 17:35 UTC (History)
1 user (show)

See Also:
Host: ia64-unknown-linux-gnu
Target: ia64-unknown-linux-gnu
Build: ia64-unknown-linux-gnu
Last reconfirmed:


Attachments
A testcase (526 bytes, application/octet-stream)
2005-09-09 19:47 UTC, H.J. Lu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2005-09-09 19:43:34 UTC
 
Comment 1 H.J. Lu 2005-09-09 19:45:37 UTC
From the gABI:

SHF_LINK_ORDER
    This flag adds special ordering requirements for link editors. The
requirements apply if the sh_link field of this section's header references
another section (the linked-to section). If this section is combined with other
sections in the output file, it must appear in the same relative order with
respect to those sections, as the linked-to section appears with respect to
sections the linked-to section is combined with.

But strip/objcopy don't set the sh_link field correctly.
Comment 2 H.J. Lu 2005-09-09 19:47:40 UTC
Created attachment 658 [details]
A testcase

[hjl@gnu-11 strip-2]$ make
as -x -o x.o x.s
cp x.o y.o
/usr/bin/strip -g y.o
readelf -t --wide x.o > x.t
readelf -t --wide y.o > y.t
diff -up x.t y.t
--- x.t 2005-09-09 12:46:37.000000000 -0700
+++ y.t 2005-09-09 12:46:37.000000000 -0700
@@ -20,10 +20,10 @@ Section Headers:
	PROGBITS	0000000000000000 000060 000010 00   0	0  8
	[0000000000000002]: ALLOC
   [ 5] .IA_64.unwind
-	IA_64_UNWIND	0000000000000000 000070 000018 00   1	1  8
+	IA_64_UNWIND	0000000000000000 000070 000018 00   0	0  8
	[0000000000000082]: ALLOC, LINK ORDER
Comment 3 H.J. Lu 2005-09-09 19:54:26 UTC
A patch is posted at

http://sourceware.org/ml/binutils/2005-09/msg00118.html
Comment 4 H.J. Lu 2005-09-29 17:35:47 UTC
Fixed.