From: M. R. B. <mr...@0x...> - 2001-10-06 21:22:25
|
* kaz Kojima <kk...@rr...> on Sat, Oct 06, 2001: > M. R. Brown" <mr...@0x...> wrote: > > If I back out the portion of kaz's patch that enables hidden, it executes > > normally. Can someone point me to a testcase where .hidden actually does > > something useful? > > It isn't useful but is required. :-) A very artificial example is: > > int f (int x) > { > int j; > register long reg0 asm ("%r0") = x; > > j = 7/reg0; > return reg0 + j; > } > > If you compile it with -O2, you'll get > > f: > mov.l .L2,r1 > mov r4,r0 > mov.l r14,@-r15 > mov r0,r5 > sts.l pr,@-r15 > jsr @r1 > mov #7,r4 > sts fpul,r1 > mov r15,r14 > add r0,r1 > mov r1,r0 > mov r14,r15 > lds.l @r15+,pr > rts > mov.l @r15+,r14 > .L3: > .align 2 > .L2: > .long __sdivsi3_i4 > > Notice that this code assumes that R0 is kept across the call > of __sdivsi3_i4. If this code is in an executable and the linker > finds __sdivsi3_i4 from the shared library, linker fixes the > content at .L2 so to refers PLT for __sdivsi3_i4. But PLT code > clobbers R0, so the result of f() will be wrong in such case. > > Well, I don't use gcc-3.0.1 from ftp.m17n.org/pub/super-h/testing > (Sorry, I'm a 3.1 user :-)), but > Ok, I'm currently using gcc-3.1 (20011006) with your patches. I still have problems at runtime when executing apps that have been linked against libstdc++: ./table: error while loading shared libraries: /lib/libstdc++.so.4: undefined symbol: __udivsi3_i4 So whereas I'm no longer confused about what .hidden *intends* to accomplish, it still doesn't do what it's supposed to do. The above is from running a Qt/Embedded example, QtE is built entirely using shared libraries. If you can tell me why this breaks, or can point me to an interim fix (yes, I know you've explained .hidden, I understand that, but obviously it doesn't work in all cases), I'd appreciate it. Better than that, kaz, what's your setup? How do you bootstrap gcc, build glibc, and build the final gcc? As I've said, I'm using your latest patches, except with the + %{!symbolic:-lc -lnss_files -lnss_dns -lresolv -lc}}" removed from gcc/config/linux.h. Any ideas? M. R. |