[PATCH] D145962: [lld] Fill .text section gaps with INT3 only on x86 targets.

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 14 13:54:21 PDT 2023


mstorsjo accepted this revision.
mstorsjo added a comment.

LGTM, thanks!

In D145962#4193828 <https://reviews.llvm.org/D145962#4193828>, @jacek wrote:

> In D145962#4192325 <https://reviews.llvm.org/D145962#4192325>, @mstorsjo wrote:
>
>> So, MS link.exe fills sections with zero? Is that a specific design choice (i.e. does it fill with `0xcc` on x86) or is it simply the case that link.exe doesn't try to fill sections with sentinel instructions at all?
>
> It seems to be a design choice: link.exe does fill with 0xcc on x64. I will add a test case for x64.

Ok, thanks for confirming!

> FWIW, in on ARM64EC it's a bit more complicated, because we may have both x64 and true ARM64EC code linked together in a single module. Both use the same section (although according to my testing, never the same page, thus even more potential gaps). In theory, it could make sense to use 0xcc fill for x64 parts, but that's not what link.exe does: it uses 0 to fill everything.

Yeah that sounds more complex. I guess as you say, it could be possible to do varying filling, but that sounds quite complex, so I guess they've just haven't gone out of their way to implement that.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145962/new/

https://reviews.llvm.org/D145962



More information about the llvm-commits mailing list