public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Michael Enright <mike@kmcardiff.com>
To: cygwin@cygwin.com
Subject: Defaulting to stabs debug output from AS Cygwin64
Date: Tue, 15 May 2018 12:49:00 -0000	[thread overview]
Message-ID: <CAOC2fq-rSqiikBs2r3K-s=G6VWfGu_bE19KFEdn8jymwkTreBQ@mail.gmail.com> (raw)

I am working on a little compiler for fun, which generates assembly
code. At this point I manually invoke as and ld.

For debugging I added the -g option to the invocation of as, but then
ld failed with

 t.o:t.s:1:(.stab+0x14): relocation truncated to fit: R_X86_64_32
against `.text'

Looking into this on Stack Overflow I was taught that stabs is
obsolete. I think 'obsolete' may not be quite the right
interpretation, but 'wrong for Cygwin64' could be the right story.
Practically speaking, without thinking about it too critically,
-gdwarf2 in place of -g is the solution.

I'm trying to find authority for saying anything exact about the situation:
1) Is there a reason why stabs is the default for '-g' with Cygwin64?
1a) Is a patch desired to make dwarf2 the default?
2) Is there a way within Cygwin64 that a .o file with stabs can be
properly processed by ld to give proper input to gdb?
3) Is stabs fatally flawed for the purposes of Cygwin64 or could it be
upgraded, within the existing meaning of the stabs specification, so
that it would work?
3a) To put it another way, is this just a stabs bug that could be
fixed for Cygwin64?

Above when I say Cygwin64, I'm talking about straightforward native
use of as, ld, and gdb, not cross-compiling to some other platform.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

             reply	other threads:[~2018-05-15  4:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-15 12:49 Michael Enright [this message]
2018-05-15 13:18 ` cyg Simple
2018-05-15 17:41   ` Michael Enright
2018-05-15 21:18     ` Hans-Bernhard Bröker

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='CAOC2fq-rSqiikBs2r3K-s=G6VWfGu_bE19KFEdn8jymwkTreBQ@mail.gmail.com' \
    --to=mike@kmcardiff.com \
    --cc=cygwin@cygwin.com \
    /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).