ld64 and getsectdata(): incorrect behavior on sections
ld64 and getsectdata(): incorrect behavior on sections
- Subject: ld64 and getsectdata(): incorrect behavior on sections
- From: email@hidden
- Date: Thu, 28 Mar 2013 08:32:38 +0400
Dear list,
During stage of porting of an old code which uses linker sets and had been linked by now obsoleted ld from cctools i've found that sets are broken when linked with ld64.
Here is a sample code to reproduce the bug: http://pastebin.com/TCbeYzNA . Now please try to build on the system with ld (if you have such environment) and then build on system with ld64. Compare results. Latest will always fail.
This is the correct behavior:
Program output
Number of entries in section: 3
Data of first entry: 5
Section contents
otool -s __DATA my a.out
a.out:
Contents of (__DATA,my) section
00003080 00003018 0000301c 00003020
with following ld version:
ld -v
Apple Computer, Inc. version cctools-622.9~2
And incorrect one using ld64:
Program output
Number of entries in section: 3
'./a.out ' terminated by signal SIGSEGV (Address boundary error)
Section contents
otool -s __DATA my a.out
a.out:
Contents of (__DATA,my) section
0000000100001030 24 10 00 00 01 00 00 00 28 10 00 00 01 00 00 00
0000000100001040 2c 10 00 00 01 00 00 00
ld -v
@(#)PROGRAM:ld PROJECT:ld64-136
configured to support archs: armv6 armv7 armv7s i386 x86_64
LTO support using: LLVM version 3.2svn, from Apple Clang 4.2 (build 425.0.27)
Any ideas how to workaround this problem?
( Is any build of an old ld for i386 or/and x86_64 uploaded somewhere publicly or otherwise build instructions for it? )
Thanks much.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden