public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Saul Tamari <stamari@gmail.com>
To: gcc-help@gcc.gnu.org
Subject: Moving C++ code to a different ELF section
Date: Wed, 19 Feb 2014 13:57:00 -0000	[thread overview]
Message-ID: <CAGqvRw5VEE3So5CWGuZKf0YCOtYSiAAKr4+YwjYjKk9NaJGe8w@mail.gmail.com> (raw)

Hi,

I'm trying to move some C++ code to a different ELF section and am
facing some errors which I don't understand. I'm using g++ v4.8.1 on
x86.

When compiling the following code I'm getting these errors:
/tmp/ccpp2AkE.s: Assembler messages:
/tmp/ccpp2AkE.s:63: Error: CFI instruction used without previous .cfi_startproc
/tmp/ccpp2AkE.s:64: Error: CFI instruction used without previous .cfi_startproc
/tmp/ccpp2AkE.s:66: Error: .cfi_endproc without corresponding .cfi_startproc
/tmp/ccpp2AkE.s: Error: open CFI at the end of file; missing
.cfi_endproc directive


The source is:
#include <iostream>
#include <stdlib.h>

int qqq;

int main(int argc, char* argv[])
{
        std::cout << "hey " << std::endl;

        qqq = rand();
        if (qqq > 0x1000000) {
                asm volatile ("jmp 1f \n\t  .pushsection
__kuku,\"ax\",@progbits \n\t 1:");
                std::cout << "0x123456" << std::endl;
                throw 12345;
                asm volatile("jmp 3f \n\t .popsection  \n\t 3:");
        }

        return 0;
}


What do these errors mean? Is there a way to fix them? Is there an
alternate method to move similar code to a different section?


Thanks,
Saul

             reply	other threads:[~2014-02-19 13:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-19 13:57 Saul Tamari [this message]
2014-02-19 14:11 ` Ian Lance Taylor
2014-02-19 15:15   ` Saul Tamari
2014-02-19 17:01     ` Ian Lance Taylor
2014-02-19 17:27       ` Saul Tamari
2014-02-19 17:45         ` Ian Lance Taylor
2014-02-19 18:21           ` Saul Tamari

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGqvRw5VEE3So5CWGuZKf0YCOtYSiAAKr4+YwjYjKk9NaJGe8w@mail.gmail.com \
    --to=stamari@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).