binaryninja-api icon indicating copy to clipboard operation
binaryninja-api copied to clipboard

Extern section backed by executable segment is not extern semantics

Open emesare opened this issue 2 months ago • 0 comments

When defining an extern section to model some external rom code, one may consider backing it with a r+x segment, this will result in the IsOffsetExternSemantics function returning false, which will cause calls into that section to not go down the "external code" path.

Image
>>> bv.is_offset_extern_semantics(0x400081d4)
False
>>> bv.is_offset_executable(0x400081d4)
True
>>> bv.get_sections_at(0x400081d4)
[<section rom.code.2: 0x40008000-0x40060000>]
>>> bv.get_segment_at(0x400081d4)
<segment: 0x40008000-0x40060000, r-x>

I don't really know why we must disallow extern sections if backed by executable segment, my gut tells me this might have been a accident, I can't really think of a situation where the current behavior is warranted.

emesare avatar Dec 04 '25 22:12 emesare