* [parisc-linux] Module Relocation Problem
@ 2006-06-06 1:45 Kai Holthaus
2006-06-06 2:20 ` John David Anglin
0 siblings, 1 reply; 13+ messages in thread
From: Kai Holthaus @ 2006-06-06 1:45 UTC (permalink / raw)
To: parisc-linux
[-- Attachment #1.1: Type: text/plain, Size: 1028 bytes --]
Hi,
I'm trying to compile and install the qc-usb (http://qce-ga.sourceforge.net/)
kernel module on my A5005X server. Compilation works just fine (make all &&
make install), but upon insmodding I get the following error:
Module quickcam, symbol qc_proc_init is out of range for PCREL22F relocation
FATAL: Error inserting quickcam (/lib/modules/2.6.16-pa11/misc/quickcam.ko):
Invalid module format
I've searched on google (in general) and on this mailing list for help on this
topic, but couldn't find anything that would help me out, since I'm not
really a kernel and/or gcc wiz.
What am I doing wrong? Or is there something in the module code that's not
compatible with a 64bit hppa kernel?
Thanks so much,
Kai
--
Hofstadter's Law:
"It always takes longer than you expect,
even when you take into account Hofstadter's Law."
-- Douglas R. Hofstadter
kmh.AT.sonic.net
Check out Mission Octagon - a new, exciting novel!
http://www.missionoctagon.com
[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 169 bytes --]
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [parisc-linux] Module Relocation Problem
2006-06-06 1:45 [parisc-linux] Module Relocation Problem Kai Holthaus
@ 2006-06-06 2:20 ` John David Anglin
2006-06-06 2:26 ` John David Anglin
2006-06-06 2:38 ` Kai Holthaus
0 siblings, 2 replies; 13+ messages in thread
From: John David Anglin @ 2006-06-06 2:20 UTC (permalink / raw)
To: Kai Holthaus; +Cc: parisc-linux
> Module quickcam, symbol qc_proc_init is out of range for PCREL22F relocation
> =46ATAL: Error inserting quickcam (/lib/modules/2.6.16-pa11/misc/quickcam.k=
> o):=20
I believe that this has come up before. The out of range
PCREL22F relocation implies that the module has a "b,l" instruction
(call) whose target can't be reached. The maximum branch distance
for the "b,l" instruction is ~ 8 MB, so the module must be quite
large.
You might explore ways to reduce the modules's (e.g., limit inlining).
You might also try compiling with the -mlong-calls options. This forces
GCC to use the "bve" instruction for calls in PA 2.0 compilations. The
call setup using bve is slightly longer but there are no distance
limitations. There's also a PA 1.x variant using "ble". What's unclear
to me is whether the kernel loader has support for the relocations used
in these sequences.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [parisc-linux] Module Relocation Problem
2006-06-06 2:20 ` John David Anglin
@ 2006-06-06 2:26 ` John David Anglin
2006-06-06 2:38 ` Kai Holthaus
1 sibling, 0 replies; 13+ messages in thread
From: John David Anglin @ 2006-06-06 2:26 UTC (permalink / raw)
To: John David Anglin; +Cc: parisc-linux
> You might explore ways to reduce the modules's (e.g., limit inlining).
> You might also try compiling with the -mlong-calls options. This forces
> GCC to use the "bve" instruction for calls in PA 2.0 compilations. The
> call setup using bve is slightly longer but there are no distance
> limitations. There's also a PA 1.x variant using "ble". What's unclear
> to me is whether the kernel loader has support for the relocations used
> in these sequences.
Just thinking, the problem might be going the other way. If so, reorganzing
the sections used for functions called from the kernel might help.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [parisc-linux] Module Relocation Problem
2006-06-06 2:20 ` John David Anglin
2006-06-06 2:26 ` John David Anglin
@ 2006-06-06 2:38 ` Kai Holthaus
2006-06-06 3:07 ` John David Anglin
1 sibling, 1 reply; 13+ messages in thread
From: Kai Holthaus @ 2006-06-06 2:38 UTC (permalink / raw)
To: parisc-linux
[-- Attachment #1.1: Type: text/plain, Size: 1157 bytes --]
> You might explore ways to reduce the modules's (e.g., limit inlining).
> You might also try compiling with the -mlong-calls options. This forces
> GCC to use the "bve" instruction for calls in PA 2.0 compilations. The
> call setup using bve is slightly longer but there are no distance
> limitations. There's also a PA 1.x variant using "ble". What's unclear
> to me is whether the kernel loader has support for the relocations used
> in these sequences.
I think I'm clearly out of my league here, since I honestly don't understand
bve vs ble... :(
Anyway - I tried compiling the module with the "-mlong-calls" option - now I
get a different error message upon trying to insert the module into the
kernel:
module quickcam: Unknown relocation: 10
Does that tell you anything? Because I have no clue...
Thanks so much for your help!
Kai
--
Hofstadter's Law:
"It always takes longer than you expect,
even when you take into account Hofstadter's Law."
-- Douglas R. Hofstadter
kmh.AT.sonic.net
Check out Mission Octagon - a new, exciting novel!
http://www.missionoctagon.com
[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 169 bytes --]
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [parisc-linux] Module Relocation Problem
2006-06-06 2:38 ` Kai Holthaus
@ 2006-06-06 3:07 ` John David Anglin
2006-06-06 3:20 ` Kai Holthaus
0 siblings, 1 reply; 13+ messages in thread
From: John David Anglin @ 2006-06-06 3:07 UTC (permalink / raw)
To: Kai Holthaus; +Cc: parisc-linux
> Anyway - I tried compiling the module with the "-mlong-calls" option - now =
> I=20
> get a different error message upon trying to insert the module into the=20
> kernel:
> module quickcam: Unknown relocation: 10
That's R_PARISC_PCREL21L. I was afraid this might happen.
About the only easy things are "-Os" and "-fno-inline-functions".
These might shrink the module a bit. Oh, "-fno-unroll-loops" might
also help.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [parisc-linux] Module Relocation Problem
2006-06-06 3:07 ` John David Anglin
@ 2006-06-06 3:20 ` Kai Holthaus
2006-06-06 3:49 ` John David Anglin
0 siblings, 1 reply; 13+ messages in thread
From: Kai Holthaus @ 2006-06-06 3:20 UTC (permalink / raw)
To: John David Anglin; +Cc: parisc-linux
[-- Attachment #1.1: Type: text/plain, Size: 985 bytes --]
> That's R_PARISC_PCREL21L. I was afraid this might happen.
>
> About the only easy things are "-Os" and "-fno-inline-functions".
> These might shrink the module a bit. Oh, "-fno-unroll-loops" might
> also help.
Thanks again for your help - and unfortunately these didn't do the trick,
either - same results.
Looking over your earlier reply, you indicated that the module must be
quite "large" - do you mean file size of the .ko file?
Because that is way under the 8MB you mentioned - the file is around 200kB in
size...
The qc-usb module is a driver for Logitech's QuickCam Express cameras, which
are using the kernel usb and video4linux drivers...
Thanks again,
Kai
--
Hofstadter's Law:
"It always takes longer than you expect,
even when you take into account Hofstadter's Law."
-- Douglas R. Hofstadter
kmh.AT.sonic.net
Check out Mission Octagon - a new, exciting novel!
http://www.missionoctagon.com
[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 169 bytes --]
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [parisc-linux] Module Relocation Problem
2006-06-06 3:20 ` Kai Holthaus
@ 2006-06-06 3:49 ` John David Anglin
2006-06-06 12:51 ` Thibaut VARENE
0 siblings, 1 reply; 13+ messages in thread
From: John David Anglin @ 2006-06-06 3:49 UTC (permalink / raw)
To: Kai Holthaus; +Cc: parisc-linux
> Looking over your earlier reply, you indicated that the module must be=20
> quite "large" - do you mean file size of the .ko file?
> Because that is way under the 8MB you mentioned - the file is around 200kB =
> in=20
> size...
I wonder if that implies a bug a bug in the kernel loader. I could
see a problem with PCREL17F relocations with files around 200kB.
These are used with the PA 1.x "bl" instruction. The range for
"bl" instructions is about +/- 262kB. The range for the 22F "b,l"
instruction is 32 times larger.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [parisc-linux] Module Relocation Problem
2006-06-06 3:49 ` John David Anglin
@ 2006-06-06 12:51 ` Thibaut VARENE
2006-06-14 8:02 ` Randolph Chung
0 siblings, 1 reply; 13+ messages in thread
From: Thibaut VARENE @ 2006-06-06 12:51 UTC (permalink / raw)
To: John David Anglin; +Cc: parisc-linux
On 6/6/06, John David Anglin <dave@hiauly1.hia.nrc.ca> wrote:
> > Looking over your earlier reply, you indicated that the module must be=20
> > quite "large" - do you mean file size of the .ko file?
> > Because that is way under the 8MB you mentioned - the file is around 200kB =
> > in=20
> > size...
>
> I wonder if that implies a bug a bug in the kernel loader. I could
> see a problem with PCREL17F relocations with files around 200kB.
> These are used with the PA 1.x "bl" instruction. The range for
> "bl" instructions is about +/- 262kB. The range for the 22F "b,l"
> instruction is 32 times larger.
A number of kernel modules fail to load nowadays on parisc. That
includes xfs, netfilter, ipv6... Some are known bloated big ones, but
others are quite surprising. In any case that's clearly a problem we
want to fix at some point.
I remember Randolph saying that might indeed be a kernel loader
issue... Randolph, any thought?
HTH
T-Bone
--
Thibaut VARENE
http://www.parisc-linux.org/~varenet/
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [parisc-linux] Module Relocation Problem
2006-06-06 12:51 ` Thibaut VARENE
@ 2006-06-14 8:02 ` Randolph Chung
2006-06-14 16:47 ` James Bottomley
0 siblings, 1 reply; 13+ messages in thread
From: Randolph Chung @ 2006-06-14 8:02 UTC (permalink / raw)
To: Thibaut VARENE; +Cc: John David Anglin, parisc-linux
> A number of kernel modules fail to load nowadays on parisc. That
> includes xfs, netfilter, ipv6... Some are known bloated big ones, but
> others are quite surprising. In any case that's clearly a problem we
> want to fix at some point.
>
> I remember Randolph saying that might indeed be a kernel loader
> issue... Randolph, any thought?
ok, several things:
- I looked at fixing this in binutils, which is really the "right" place
to fix this; unfortunately the changes required are very extensive, so I
gave up
- I looked at using -mlong-calls to address this issue. I've added the
missing relocation that was reported in a previous message on this
thread, but there are other problems - with modules compiled with
-mlong-call I am seeing rather bizarre crashes that I have not had time
to debug further. I do not yet know why they are happening, although I
suspect it has to do with bve clobbering r31. I'm not yet sure if this
is a kernel problem or a gcc problem.
- As to "small" modules causing the out of bounds problem - I haven't
really looked at any modules other than ipv6. If there's a particular
one that is "surprising", I can take a look. Usually it's quite obvious
where the out of bounds problem is.
- As an aside, while looking at the module loading problem, I've
convinced myself that the 64-bit module loader is wrong. OTOH, it seems
to work in most cases, so there's clearly something that I don't yet
understand.....
The module loader has a hard coded limit for the number of GOT entries.
We can exceed this rather easily in some cases when we are using long calls.
randolph
--
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [parisc-linux] Module Relocation Problem
2006-06-14 8:02 ` Randolph Chung
@ 2006-06-14 16:47 ` James Bottomley
0 siblings, 0 replies; 13+ messages in thread
From: James Bottomley @ 2006-06-14 16:47 UTC (permalink / raw)
To: Randolph Chung; +Cc: John David Anglin, parisc-linux, Thibaut VARENE
On Wed, 2006-06-14 at 16:02 +0800, Randolph Chung wrote:
> - As an aside, while looking at the module loading problem, I've
> convinced myself that the 64-bit module loader is wrong. OTOH, it
> seems
> to work in most cases, so there's clearly something that I don't yet
> understand.....
Well ... OK ... since I made that work I can try to remember how I did
it ... what seems to be the problem?
James
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [parisc-linux] Module Relocation Problem
[not found] ` <448B184F.7020309@tiscali.be>
@ 2006-06-26 2:02 ` Kai Holthaus
2006-06-26 2:10 ` Kyle McMartin
0 siblings, 1 reply; 13+ messages in thread
From: Kai Holthaus @ 2006-06-26 2:02 UTC (permalink / raw)
To: Joel Soete; +Cc: parisc-linux
[-- Attachment #1.1: Type: text/plain, Size: 1266 bytes --]
> 1. How do I compile the qc-usb driver directly into the kernel rather
> than as a standalone module?
>
> At the moment, it is not possible without a lot of work to build the
> qc-usb driver into the kernel. We recommend building qc-usb driver as a
> separate module rather than directly into the kernel. [snip]
>
> So apparently there is a few chance but regarding the generic advise it
> could be out dated, the best is certainly to contact developers to get an
> actual status ;-)
Thanks for the help and advice - here's the answer from the developer:
"I haven't tried doing this recently. I made a couple of attempts to
shoehorn the driver into the kernel build system, but it ended up being
a rathole I didn't want to go down until I've cleaned up the driver
itself. Integrating the qc-usb driver into the kernel is definitely on
the TODO list, just not right now. Sorry."
> Appology if I don't have much more help to offer (no hardware and mainly
> dramaticaly lakes of time, specialy for the moment).
This has all been very helpful. If it is indeed a problem in the hppa-linux
kernel, I'll keep a watchful eye out for fixes. If there's anything a kernel
layman like me can do, please let me know.
Thanks,
Kai
[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 169 bytes --]
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [parisc-linux] Module Relocation Problem
2006-06-26 2:02 ` Kai Holthaus
@ 2006-06-26 2:10 ` Kyle McMartin
[not found] ` <200606252124.58264.kmh@sonic.net>
0 siblings, 1 reply; 13+ messages in thread
From: Kyle McMartin @ 2006-06-26 2:10 UTC (permalink / raw)
To: Kai Holthaus; +Cc: parisc-linux
On Sun, Jun 25, 2006 at 07:02:04PM -0700, Kai Holthaus wrote:
> This has all been very helpful. If it is indeed a problem in the hppa-linux
> kernel, I'll keep a watchful eye out for fixes. If there's anything a kernel
> layman like me can do, please let me know.
>
Ironic that you mentioned this today. The fix to module.c James
committed yesterday should fix this for you. Please try 2.6.17-pa6 and
see if that helps.
Cheers,
Kyle M.
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [parisc-linux] Module Relocation Problem
[not found] ` <200606252124.58264.kmh@sonic.net>
@ 2006-06-26 12:10 ` Kyle McMartin
0 siblings, 0 replies; 13+ messages in thread
From: Kyle McMartin @ 2006-06-26 12:10 UTC (permalink / raw)
To: Kai Holthaus; +Cc: parisc-linux
On Sun, Jun 25, 2006 at 09:24:57PM -0700, Kai Holthaus wrote:
> Jun 25 21:20:02 obelix kernel: ioctl32(qcset:2965): Unknown cmd fd(3)
> cmd(403c7601){00} arg(c05cd808) on /dev/video0
>
On a first look, it sounds like the driver is not properly handling
compat_ioctl (32bit ioctls on a 64bit kernel).
I can try to take a look sometime this week, unless someone else
beats me to it.
Cheers,
Kyle
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2006-06-26 12:10 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-06 1:45 [parisc-linux] Module Relocation Problem Kai Holthaus
2006-06-06 2:20 ` John David Anglin
2006-06-06 2:26 ` John David Anglin
2006-06-06 2:38 ` Kai Holthaus
2006-06-06 3:07 ` John David Anglin
2006-06-06 3:20 ` Kai Holthaus
2006-06-06 3:49 ` John David Anglin
2006-06-06 12:51 ` Thibaut VARENE
2006-06-14 8:02 ` Randolph Chung
2006-06-14 16:47 ` James Bottomley
[not found] <J0FGHF$3C34E7AFFFACE857F314B50EFB7BB29D@scarlet.be>
[not found] ` <200606101105.38472.kmh@sonic.net>
[not found] ` <448B184F.7020309@tiscali.be>
2006-06-26 2:02 ` Kai Holthaus
2006-06-26 2:10 ` Kyle McMartin
[not found] ` <200606252124.58264.kmh@sonic.net>
2006-06-26 12:10 ` Kyle McMartin
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.