Skip to content

ARM64 branch out of range #103073

Closed
Closed

Description

@MichalStrehovsky

Seen in the following test run for the Microsoft.Extensions.Logging.Generators.Roslyn4.8.Tests test. This is a new test added last week.

https://dev.azure.com/dnceng-public/public/_build/results?buildId=698028&view=logs&jobId=81f19b99-bbe6-5a12-eb99-6b7b5bb4d46c&j=81f19b99-bbe6-5a12-eb99-6b7b5bb4d46c&t=f9edd3c6-1507-5379-7d58-42697b2d6930

PR #103069

I'm going to fully disable the test because we don't want to run source generator tests with native AOT (they include entire Roslyn, are not trim safe and in general a pain) and all the other ones are already disabled. But this is probably a representative "massive executable" issue.

  ld: b(l) ARM64 branch out of range (134218280 max is +/-128MB): from _SystemNative_Write (0x10015AE9C) to _write.stub@0x00000000 (0x10815B0F0) in '_SystemNative_Write' from /Users/runner/work/1/s/artifacts/bin/testhost/net9.0-osx-Release-arm64/shared/Microsoft.NETCore.App/9.0.0/libSystem.Native.a(pal_io.c.o)
  clang: error: linker command failed with exit code 1 (use -v to see invocation)

Activity

  1. added
    untriaged
    on Jun 5, 2024
  2. dotnet-policy-service commented on Jun 5, 2024

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
    See info in area-owners.md if you want to be subscribed.

  3. filipnavara commented on Jun 5, 2024

    @filipnavara
    Member

    Is that in a debug build? I wanted to write about it but I didn’t find a realistic scenario where it would be hit.

  4. MichalStrehovsky commented on Jun 5, 2024

    @MichalStrehovsky
    MemberAuthor

    Is that in a debug build? I wanted to write about it but I didn’t find a realistic scenario where it would be hit.

    The logs say it's release

  5. added this to the Future milestone on Jul 8, 2024
  6. removed
    untriaged
    on Jul 8, 2024
  7. ds5678 commented on Mar 24, 2025

    @ds5678

    Is that in a debug build? I wanted to write about it but I didn’t find a realistic scenario where it would be hit.

    While I'm not sure if I've encountered the exact error mentioned in this issue, I do compile a large executable with NativeAOT for x64 and ARM64. Occasionally, I have to find ways to be more size-conscious in my codebase. ARM64 compilation fails if the final output would be significantly larger than 128MB.

    https://github.com/AssetRipper/AssetRipper

    Most recently, the error I encountered was:

    error LNK2013: BRANCH26 fixup overflow.  Target 'RhpNewArray' is out of range
    error LNK2013: BRANCH26 fixup overflow.  Target '{thunk}RhpNewArray' is out of range 
    

    I would be happy to help with this if I can. The size limitation has been frustrating for me, and it'd be a relief to no longer worry about that.

  8. jkotas commented on Nov 16, 2026

    @jkotas
    Member

    Fixed by linker PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status
      No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions