public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chaskiel Grundman <cg2v@andrew.cmu.edu>
To: linux-kernel@vger.kernel.org
Subject: (alpha) process_reloc_for_got confuses r_offset and r_addend
Date: Mon, 5 Sep 2005 13:53:22 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.63.0509051334440.8784@localhost> (raw)

arch/alpha/kernel/module.c:process_reloc_for_got(), which figures out how 
big the .got section for a module should be, appears to be confusing 
r_offset (the file offset that the relocation needs to be applied to) with 
r_addend (the offset of the relocation's actual target address from the 
address of the relocation's symbol). Because of this, one .got entry is 
allocated for each relocation instead of one each unique symbol/addend.

In the module I am working with, this causes the .got section to be almost 
10 times larger than it needs to be (75544 bytes instead of 7608 bytes). 
As the .got is accessed with global-pointer-relative instructions, it 
needs to be within the 64k gp "zone", and a 75544 byte .got clearly does 
not fit. The result of this is that relocation overflows are detected 
during module load and the load is aborted.

Does anyone see anything wrong with this analysis? I tested a patch that 
makes the obvious change to struct got_entry/process_reloc_for_got and it 
seems to work ok.

(Please cc me on replies. thanks)

             reply	other threads:[~2005-09-05 17:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-05 17:53 Chaskiel Grundman [this message]
2005-09-05 18:33 ` (alpha) process_reloc_for_got confuses r_offset and r_addend Jesper Juhl
2005-09-05 18:42   ` Chaskiel Grundman
2005-09-06 21:10     ` Richard Henderson

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=Pine.LNX.4.63.0509051334440.8784@localhost \
    --to=cg2v@andrew.cmu.edu \
    --cc=linux-kernel@vger.kernel.org \
    /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