From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Merrill To: wilson@cygnus.com (Jim Wilson) Cc: egcs@cygnus.com, Robert Lipe , jason@cygnus.com Subject: Re: dwarf2 debug dependent upon GAS? Date: Sun, 28 Feb 1999 22:53:00 -0000 Message-ID: References: <19990221144644.M8783.cygnus.egcs@rjlhome.sco.com> <199902230124.RAA24440.cygnus.egcs@rtl.cygnus.com> X-SW-Source: 1999-02n/msg01273.html Message-ID: <19990228225300.eXeayc6GFwJTEUHyWVoqEWYnSapqhomwJVFRrSU0VOw@z> >>>>> Jim Wilson writes: >> I'm seeing EGCS (current trunk) generate refences to symbols that don't >> exist. There are SECTIONS of that name, but no symbols. Apparently >> GAS treat them interchangably. Is it the intent for these to reference >> the beginning of the section in this file (i.e. local labels) or the >> beginning of that section once linked? (without making them global, I >> don't know how I would synthesize that.) > The latter, sort of. The dwarf2 standard says that some fields are > offsets relative to the address of the final linked section. This means > that we can't compute these offsets until link time. Actually, it's a lot simpler than that. The references are not to the beginning of the section in the executable, but to the offset from there to the beginning of the info for the particular translation unit. Since the beginning of the section is at 0, this simplifies to the address of the beginning of the section in question for the current translation unit. In GNU as, SGI as and Sun as, referring to a section name as a symbol gives us that. If SCO doesn't support this feature (which I assumed was standard SVR4), it would be simple enough to emit some random symbol at the beginning of the assembly output and refer to that instead. Jason