Conversation
FDPIC dynamic linker assumed mutable text and walked every relocation
through aa callback dispatch, both wasteful on a Cortex-M XIP target
where library text lives in flash and lazy binding eats RAM that
userspace needs.
0021 reworks the loader so XIP is the default path:
- inline loadmap in struct elf_resolve for the common nsegs <= 2 case
- per-module chunked function-descriptor allocator with intrusive
hashtable promoted on a 16-entry threshold
- ARM eager binding via DL_FORCE_BIND_NOW
- XIP classification (DL_FDPIC_XIP_TEXT / DL_FDPIC_MUTABLE_TEXT) gated
by p_align with a cached read-only loadseg bitmask and overflow
fallback for modules with more PT_LOADs than fit in the bitmask
- relocation-time XIP write guards on per-relocation and batched
R_ARM_RELATIVE paths
- direct ARM relocation parser in place of per-reloc callback dispatch
- AUX_MAX_AT_ID raised to 45 so AT_FDPIC_EXEC_MAP / AT_FDPIC_INTERP_MAP
are reachable in _dl_auxvt
- arm_fdpic_find_loadseg honors one-past-end on the last segment so
_end-style symbol relocation works
- per-segment batching in elf_machine_relative
0022 closes follow-up review findings without changing the policy:
- broaden the writable-text fallback gate so the mprotect / map_writeable
path fires for any XIP demotion (DT_TEXTREL or xip_mapped_text loss),
not only DT_TEXTREL. Prevents a non-DT_TEXTREL XIP-incompatible
object from relocating against a read-only mapping.
- replace base + p_memsz end-address arithmetic with subtraction-based
bounds (offset = addr - base; offset < memsz) in
arm_fdpic_find_loadseg{,_runtime}, arm_addr_is_readonly_load_slow,
and arm_abort_xip_text_reloc, defeating wraparound on malformed
inputs that could route a write past both the XIP guard and the
fallback. The last-segment one-past-end allowance is preserved
via a small helper.
- classify FDPIC objects with no executable PT_LOAD as
DL_FDPIC_MUTABLE_TEXT instead of leaving them unclassified, so
callers always see a defined text mode.
- document that DL_FDPIC_STRICT_XIP() must expand to a preprocessor
constant since it is consumed by both a runtime if and a #if gate.
Subsystem RollupResident Top 12 buckets by resident
Budget gate: ok
Source: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FDPIC dynamic linker assumed mutable text and walked every relocation through aa callback dispatch, both wasteful on a Cortex-M XIP target where library text lives in flash and lazy binding eats RAM that userspace needs.
0021 reworks the loader so XIP is the default path:
0022 closes follow-up review findings without changing the policy: