Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9177343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:18:16+00:00 2026-06-17T17:18:16+00:00

As soon as I’m trying to use labels in inline assembly code the app

  • 0

As soon as I’m trying to use labels in inline assembly code the app crashes immediately after the accordant asm statement because of incomprehensible EAX_BAD_ACCESS errors.

For example consider the following code:

asm volatile (
    "myloop:    \n"
    :
    :
    :
);

Why causes this snippet always a crash? I’m using Xcode 4.3.1 with gcc 4.2.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T17:18:17+00:00Added an answer on June 17, 2026 at 5:18 pm

    The issue is with the linker in the apple toolchain. I faced this issue too.
    The linker takes any label from the generated assembly and assumes it to be a function start and relocates the section starting from the label. This causes some code to be truncated without function epilog and leaving the PC to be orphaned and drifting to whatever section/function/routine is at next address.
    The linker understands a local label in two ways (as i understand from reverse engg.)
    1. use a capital ‘L’ in start of label name. This is how the compiler marks its own local labels(loop etc).
    2. use numeric labels eg “0:” etc and use directional branching like “b 0f” for forward jump and “b 0b” for backward.
    Hence the solution to your prob:
    asm volatile (
    “Lmyloop: \n”
    :
    :
    :
    );

    Or
    asm volatile (
    “0: \n”
    :
    :
    :
    );

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

as soon as I use method Game(), my app crashes, why? Also I'd like
How soon after the reference count reaches zero is __del__ method called? Does the
I'm soon going to be starting some iPhone Development (3.0) building a simple app
Soon after starting a new project I realized, that I'm not getting the correct
As soon as I check Use Entitlements File in Xcode, I get the following
As soon as I figured out how to invoke my app as a Backends
As soon as I insert errorPlacement: function, it breaks the code. No validation happens
As soon as I dump my code into the www folder of my PhoneGap
Soon I'll have to make a JS browser app, and for that I'll need
We will soon be rewriting a 5 year old rails app, with a very

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.