public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* (alpha) process_reloc_for_got confuses r_offset and r_addend
@ 2005-09-05 17:53 Chaskiel Grundman
  2005-09-05 18:33 ` Jesper Juhl
  0 siblings, 1 reply; 4+ messages in thread
From: Chaskiel Grundman @ 2005-09-05 17:53 UTC (permalink / raw)
  To: linux-kernel

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)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-09-06 21:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-05 17:53 (alpha) process_reloc_for_got confuses r_offset and r_addend Chaskiel Grundman
2005-09-05 18:33 ` Jesper Juhl
2005-09-05 18:42   ` Chaskiel Grundman
2005-09-06 21:10     ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox