9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Bence Fábián" <begnoc@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] Linking error with 8l, guys, could you tell
Date: Wed, 28 Nov 2012 12:43:59 +0100	[thread overview]
Message-ID: <CAOCRf5VyfrmzSeF9HNjmOMUCan9mDWpr=eTYTSv85wgXG0EFKA@mail.gmail.com> (raw)
In-Reply-To: <e46f819d-90d9-4155-ac9e-95f93ba14f54@googlegroups.com>

[-- Attachment #1: Type: text/plain, Size: 5651 bytes --]

This is a multiple initialization problem. Here is an example code:

#include <u.h>
#include <libc.h>

int num = 20;
int num = 30;

void
main(void)
{
print("%d\n", num);
exits(nil);
}

relevant parts:

/sys/src/cmd/8l/asm.c:424:
/sys/src/cmd/8l/pass.c:16:



2012/11/28 keystroke <zhangrui0000@gmail.com>

> Thank you for your reply, erik.
>
> But I don't quite follow you. Are you suggesting that the error has
> nothing to do with "opnames" and "etnames", but is about the following word
> "memccpy"?
>
> I had grep opnames and etnames before, and finds only one initial place.
> And I grep memccpy, no result was found.
> There is a strange situation, when I "8l subr.c" then it's "memccpy", when
> I
> "8l *.8", it shows "create":
>
> (2050) DATA ...(same as before)
> create: multiple initialization.
> ...(same as before)
> create: multiple initialization.
>
> I suspect it is opnames and etnames that cause the problem, and I find
> something
> strange in the subr.c and it's included file go.h, is it relevant?
>
> =============================================================
> > subr.c
> =============================================================
> static char*
> opnames[] =
> {
>         [OADDR]         = "ADDR",
>         [OADD]          = "ADD",
>         [OANDAND]       = "ANDAND",
>         [OAND]          = "AND",
>         [OARRAY]        = "ARRAY",
>         [OASOP]         = "ASOP",
>         [OAS]           = "AS",
>         [OBAD]          = "BAD",
>         [OBREAK]        = "BREAK",
>         [OCALL]         = "CALL",
>         [OCALLPTR]      = "CALLPTR",
>         [OCALLMETH]     = "CALLMETH",
>         [OCALLINTER]    = "CALLINTER",
>         [OCAT]          = "CAT",
>         [OCASE]         = "CASE",
>         [OXCASE]        = "XCASE",
>         [OFALL]         = "FALL",
>         [OCONV]         = "CONV",
>         [OCOLAS]        = "COLAS",
>         [OCOM]          = "COM",
>         [OCONST]        = "CONST",
>         [OCONTINUE]     = "CONTINUE",
>         [ODCLARG]       = "DCLARG",
>         [ODCLCONST]     = "DCLCONST",
>         [ODCLFIELD]     = "DCLFIELD",
>         [ODCLFUNC]      = "DCLFUNC",
>         [ODCLTYPE]      = "DCLTYPE",
>         [ODCLVAR]       = "DCLVAR",
>         [ODIV]          = "DIV",
>         [ODOT]          = "DOT",
>         [ODOTPTR]       = "DOTPTR",
>         [ODOTMETH]      = "DOTMETH",
>         [ODOTINTER]     = "DOTINTER",
>         [OEMPTY]        = "EMPTY",
>         [OEND]          = "END",
>         [OEQ]           = "EQ",
>         [OFOR]          = "FOR",
>         [OFUNC]         = "FUNC",
>         [OGE]           = "GE",
>         [OPROC]         = "PROC",
>         [OGOTO]         = "GOTO",
>         [OGT]           = "GT",
>         [OIF]           = "IF",
>         [OINDEX]        = "INDEX",
>         [OINDEXPTR]     = "INDEXPTR",
>         [OINDEXSTR]     = "INDEXSTR",
>         [OINDEXMAP]     = "INDEXMAP",
>         [OINDEXPTRMAP]  = "INDEXPTRMAP",
>         [OIND]          = "IND",
>         [OLABEL]        = "LABEL",
>         [OLE]           = "LE",
>         [OLEN]          = "LEN",
>         [OLIST]         = "LIST",
>         [OLITERAL]      = "LITERAL",
>         [OLSH]          = "LSH",
>         [OLT]           = "LT",
>         [OMINUS]        = "MINUS",
>         [OMOD]          = "MOD",
>         [OMUL]          = "MUL",
>         [ONAME]         = "NAME",
>         [ONE]           = "NE",
>         [ONOT]          = "NOT",
>         [OOROR]         = "OROR",
>         [OOR]           = "OR",
>         [OPLUS]         = "PLUS",
>         [ODEC]          = "DEC",
>         [OINC]          = "INC",
>         [OSEND]         = "SEND",
>         [ORECV]         = "RECV",
>         [OPTR]          = "PTR",
>         [ORETURN]       = "RETURN",
>         [ORSH]          = "RSH",
>         [OSLICE]        = "SLICE",
>         [OSUB]          = "SUB",
>         [OSWITCH]       = "SWITCH",
>         [OTYPE]         = "TYPE",
>         [OVAR]          = "VAR",
>         [OEXPORT]       = "EXPORT",
>         [OIMPORT]       = "IMPORT",
>         [OXOR]          = "XOR",
>         [ONEW]          = "NEW",
>         [OFALL]         = "FALL",
>         [OXFALL]        = "XFALL",
>         [OPANIC]        = "PANIC",
>         [OPRINT]        = "PRINT",
>         [OXXX]          = "XXX",
> };
>
> =============================================================
> > go.h
> =============================================================
> enum
> {
>         OXXX,
>
>         OTYPE, OCONST, OVAR, OEXPORT, OIMPORT,
>
>         ONAME,
>         ODOT, ODOTPTR, ODOTMETH, ODOTINTER,
>         ODCLFUNC, ODCLCONST, ODCLVAR,
>         ODCLTYPE, ODCLFIELD, ODCLARG,
>         OLIST,
>         OPTR, OARRAY,
>         ORETURN, OFOR, OIF, OSWITCH,
>         OAS, OASOP, OCOLAS, OCASE, OXCASE, OFALL, OXFALL,
>         OGOTO, OPROC, ONEW, OPANIC, OPRINT, OEMPTY,
>
>         OOROR,
>         OANDAND,
>         OEQ, ONE, OLT, OLE, OGE, OGT,
>         OADD, OSUB, OOR, OXOR, OCAT,
>         OMUL, ODIV, OMOD, OLSH, ORSH, OAND,
>         ODEC, OINC,
>         OLEN,
>         OFUNC,
>         OLABEL,
>         OBREAK,
>         OCONTINUE,
>         OADDR,
>         OIND,
>         OCALL, OCALLPTR, OCALLMETH, OCALLINTER,
>         OINDEX, OINDEXPTR, OINDEXSTR, OINDEXMAP, OINDEXPTRMAP,
>         OSLICE,
>         ONOT, OCOM, OPLUS, OMINUS, OSEND, ORECV,
>         OLITERAL,
>         OCONV,
>         OBAD,
>
>         OEND,
> };
>
>

[-- Attachment #2: Type: text/html, Size: 8162 bytes --]

  reply	other threads:[~2012-11-28 11:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-26  9:49 [9fans] Linking error with 8l, guys, could you tell me where to look? keystroke
2012-11-26 13:25 ` erik quanstrom
2012-11-28 10:20   ` [9fans] Linking error with 8l, guys, could you tell keystroke
2012-11-28 11:43     ` Bence Fábián [this message]
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
2012-11-29  9:48 keystroke
2012-11-29  9:48 keystroke
2012-11-29  9:48 keystroke

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='CAOCRf5VyfrmzSeF9HNjmOMUCan9mDWpr=eTYTSv85wgXG0EFKA@mail.gmail.com' \
    --to=begnoc@gmail.com \
    --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).