Project

General

Profile

Bug #3265

link-editor builds bogus .eh_frame_hdr on ia32

Added by Rich Lowe about 8 years ago. Updated about 8 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
tools - gate/build tools
Start date:
2012-10-08
Due date:
% Done:

100%

Estimated time:
Difficulty:
Hard
Tags:
Gerrit CR:

Description

The link-editor builds bogus .eh_frame_hdr sections on ia32, due to the poor and crazy specification of DW_EH_PE_datarel.

DW_EH_PE_datarel is specified as being "relative to .eh_frame_hdr or .got", without any real further description. In practice, within .eh_frame_hdr it is relative to the start of .eh_frame_hdr, elsewhere it is relative to .got (though reportedly this may differ on other platforms).


Related issues

Blocks illumos gate - Bug #3062: illumos should build/work with GCC 4.6 or newerNewToomas Soome2012-08-07

Actions
#1

Updated by Rich Lowe about 8 years ago

So what's going on here is that on i386, we use ..._datarel values in .eh_frame (because, apparently, the Sun assembler couldn't cope with cross-section math).

Because we were interpreting these incorrectly, the values we were placing into .eh_frame_hdr were incorrect. Code using the eh_frame-based unwind, would look at the hdr, and either not match ever (and our exception would erroneously hit the top level), or would match incorrectly (since the offset from correct may be slight), and crash because it was trying to use the wrong FDE. elfdump doesn't make this obvious, because it shares the code that mis-interprets the values, so everything appears to line up.

#2

Updated by Rich Lowe about 8 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 50 to 100

Resolved in 965630c

Also available in: Atom PDF