Invalid vmsize written for LINKEDIT segment on arm64

Originator:landon.j.fuller
Number:rdar://15042905 Date Originated:20-Sep-2013
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 5 (5A1413)
Classification:Crash/Hang/Data Loss Reproducible:Always
 
Summary:
When using ld -r to produce a MH_OBJECT library from which symbols are stripped, the resulting LINKEDIT segment's vmsize does not appear to be adjusted to round_page(filesize) when linking the final executable.

Steps to Reproduce:
An example project is attached that will crash in -[PLCrashAsyncMachOImageTests testMapSegment] when the Tests-iOS-Device target is built and run with Xcode 5 5A1413 for an arm64 target.

Expected Results:
The tests pass successfully (as they do on Mac OS X x86/x86-64 and iOS armv7/armv7s).

Actual Results:
The call to getsegmentdata() returns an invalid size value that extends beyond the pages mapped for the segment; the test crashes when memcmp() reads past the end of the mapped pages in the buffer returned by getsegmentdata().

If I disable the EXPORTED_SYMBOLS_FILE (-exported_symbols_list) option, the tests pass successfully. (Note that other tests in the sample project will fail)

Version:
Xcode 5 (5A1413)

Notes:


Configuration:
iPhone 5S 7.0.1

Attachments:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!