9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] Linking error with 8l, guys, could you tell me where to look?
Date: Mon, 26 Nov 2012 08:25:13 -0500	[thread overview]
Message-ID: <a5617143b9125972cb18e1c5d4d1e4ef@brasstown.quanstro.net> (raw)
In-Reply-To: <afa0ce6d-0159-4ac6-b750-9eb924032635@googlegroups.com>

On Mon Nov 26 04:56:23 EST 2012, zhangrui0000@gmail.com wrote:
> The message is:
>
> (2050) DATA  opnames<1>+116(SB)/4,$string<1>+739(SB)
> memccpy: multiple initialization
> (2170) DATA  etnames<1)+72(SB)/4,$string<1>+912(SB)
> memccpy: multiple initialization
>
> I know 2050 is somehow related to the line number where opnames appear in the code, and so is 2170 with etnames.
> I know it's suggesting I had an opnames initialized some where, but I just don't know where to look. I read the 8l man, but it seems there is no other docs where I can check for detail information.
> Can anybody tell me what the rest number of the message means, where should I look for the duplicate code?

this is the format from 8l/list.c:/^Pconv

			snprint(str, sizeof(str), "(%ld)	%A	%D,%D",
				p->line, p->as, &p->from, &p->to);

it looks like memccpy is defined twice in the same .8.
i'd look for the symbol rather than the line number.

the format of the line number doesn't fit the plumbable
convention, which would be file:line, and also appears to
not be the line number you are expecting.  it's
the line number after include files are processed.  which
while not wrong, is not helpful either.

- erik

---
example:

; cat mdef.c
#include <u.h>
#include <libc.h>

void
x(void)
{
}

void
x(void)
{
}

void
main(void)
{
}
; tmk mdef.c
6c -FVTw mdef.c
6l -o 6.mdef mdef.6
x: mdef.6: redefinition: x
(818)	TEXT	x+0(SB),$0
; # modified 8c to output line numbers in comments
; /sys/src/cmd/8c/6.out -S mdef.c
	TEXT	x+0(SB),0,$0	/* 806 */
	RET	,	/* 808 */
	TEXT	x+0(SB),0,$0	/* 811 */
	RET	,	/* 813 */
	TEXT	main+0(SB),0,$0	/* 816 */
	RET	,	/* 818 */
	END	,	/* 818 */



  reply	other threads:[~2012-11-26 13:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-26  9:49 keystroke
2012-11-26 13:25 ` erik quanstrom [this message]
2012-11-28 10:20   ` [9fans] Linking error with 8l, guys, could you tell keystroke
2012-11-28 11:43     ` Bence Fábián
2012-11-28 11:51       ` lucio
2012-11-28 12:12         ` Bence Fábián
2012-11-28 12:22           ` Bence Fábián
2012-11-28 12:48       ` erik quanstrom

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=a5617143b9125972cb18e1c5d4d1e4ef@brasstown.quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@9fans.net \
    /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 NNTP newsgroup(s).