All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Richard Henderson <rth@twiddle.net>
Cc: torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: Re: [MODULES] fix weak symbol handling
Date: Tue, 14 Jan 2003 14:57:11 +1100	[thread overview]
Message-ID: <20030114035737.07C672C2BD@lists.samba.org> (raw)
In-Reply-To: Your message of "Mon, 13 Jan 2003 11:00:36 -0800." <20030113110036.A873@twiddle.net>

In message <20030113110036.A873@twiddle.net> you write:
>  		case SHN_UNDEF:
> +			sym[i].st_value
> +			  = resolve_symbol(sechdrs, symindex, strtab,
> +					   strtab + sym[i].st_name, mod);
> +
> +			/* Ok if resolved.  */
> +			if (sym[i].st_value != 0)
> +				break;
> +			/* Ok if weak.  */
> +			if (ELF_ST_BIND(sym[i].st_info) == STB_WEAK)
> +				break;
> +
> +			printk(KERN_WARNING "%s: Unknown symbol %s\n",
> +			       mod->name, strtab + sym[i].st_name);
> +			ret = -ENOENT;
>  			break;

I don't understand this.  For a weak symbol, st_shndx won't be
SHN_UNDEF.  And you don't want to set its value to 0, anyway.  I think
you want:

	default:
		if (ELF_ST_BIND(sym[i].st_info) == STB_WEAK) {
			unsigned long val = resolve_symbol(...);
			if (val)
				sym[i].st_value = val;
		} else
			...

Or am I missing something?
Rusty.
PS.  "s/Fix weak symbol handling/Implement weak symbol handling/" 8)
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

  parent reply	other threads:[~2003-01-14  3:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-13 19:00 [MODULES] fix weak symbol handling Richard Henderson
2003-01-14  3:11 ` Rusty Russell
2003-01-15  1:10   ` Richard Henderson
2003-01-14  3:57 ` Rusty Russell [this message]
2003-01-15  1:07   ` Richard Henderson
2003-01-14  8:39 ` Rusty Russell
2003-01-15  1:12   ` Richard Henderson
2003-01-15  4:39     ` Rusty Russell

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=20030114035737.07C672C2BD@lists.samba.org \
    --to=rusty@rustcorp.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rth@twiddle.net \
    --cc=torvalds@transmeta.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.