linux-gcc-digest Monday, 3 May 1999 Volume 01 : Number 392
In this issue:
Re: I'm confused -- segmentation fault
Re: I'm confused -- segmentation fault
Re: I'm confused -- segmentation fault
using a C function in a C++ program
Re: using a C function in a C++ program
Re: using a C function in a C++ program
gcc -shared
Re: gcc -shared
Re: gcc -shared
Error while compiling glibc-2.1: undefined symbol: _dl_global_scope_end
sigsegv -- fixed ;)
Error while compiling glibc-2.1: undefined symbol: _dl_global_scope_end
CSE bug ??
Re: CSE bug ??
stl debug
undefined symbol while compiling glibc-2.1
binutils 2.9.1.0.24 is released.
Compilation problems
REL vs. RELA, .got .plt etc.
ld.so, libdl
ES/390 gcc/egcs optimizations
changing embedded RPATH in existing executables.
Re: changing embedded RPATH in existing executables.
Help for password...
Re: Help for password...
Re: changing embedded RPATH in existing executables.
Re: Help for password...
RedHat upgrade
RE: RedHat upgrade
Re: Help for password...
RE: RedHat upgrade
[none]
Re: changing embedded RPATH in existing executables.
Re: RedHat upgrade
when are new versions released?
adv: Important Psychic Message For You...
glibc 2.1.1pre2
Re: RedHat upgrade
gnu c large int's (fwd)
See the end of the digest for information on subscribing to the linux-gcc
or linux-gcc-digest mailing lists.
----------------------------------------------------------------------
From: Przemek Borys <[EMAIL PROTECTED]>
Date: Thu, 8 Apr 1999 20:46:40 +0200
Subject: Re: I'm confused -- segmentation fault
EHLO Kurt!
> I don't know how ccmalloc works, but Electric Fence uses the
> processor hardware to detect illegal memory accesses. By default,
> its memory allocations are page aligned, so, small overruns are
> not detected. Try setting EF_ALIGNMENT=0 in the shell and see
> if you can detect the clobber. EF_PROTECT_BELOW=1 will catch
> buffer underruns.
When running efence? I'll try.
(after testing): nothing new happens. :(
>> Gdb said that all those faults came from libc_free...
> Are you compiling with "-ggdb"?
no, just -g. How much does -ggdb give?
- --
____\___\___
(_(\|,|_|,|_ Gassho! [http://dione.ids.pl/~pborys][mr MUA home]
| | |. [teksty o zen,programowaniu,moje sf,xfaq_pl, inne]
------------------------------
From: Andreas Jaeger <[EMAIL PROTECTED]>
Date: 08 Apr 1999 23:49:40 +0200
Subject: Re: I'm confused -- segmentation fault
>>>>> Przemek Borys writes:
Przemek> EHLO Andreas!
>> P.S. From the glibc2 manual:
Przemek> [...]
Przemek> Where do you have it from? Looks a bit better than the libc.info...
>From the glibc 2.1 memory.texi file which is the source for libc.info.
Andreas
- --
Andreas Jaeger [EMAIL PROTECTED] [EMAIL PROTECTED]
for pgp-key finger [EMAIL PROTECTED]
------------------------------
From: Kurt Wall <[EMAIL PROTECTED]>
Date: Thu, 8 Apr 1999 10:33:08 -0600
Subject: Re: I'm confused -- segmentation fault
On Thu, Apr 08, 1999 at 08:46:40PM +0200, Przemek Borys wrote:
> When running efence? I'll try.
> (after testing): nothing new happens. :(
Check the man pages for libefence to understand what's going on.
You might also try using mpr.
> >> Gdb said that all those faults came from libc_free...
> > Are you compiling with "-ggdb"?
>
> no, just -g. How much does -ggdb give?
- -ggdb adds some gdb specific symbols that make it easier to track down
where a problem is.
Kurt
- --
You are taking yourself far too seriously.
------------------------------
From: John <[EMAIL PROTECTED]>
Date: Fri, 9 Apr 1999 14:08:26 +0100 (British Summer Time)
Subject: using a C function in a C++ program
I have been trying for a couple of weeks now to compile a program that
consists of a C++ main function which calls a C function. I have tried
using the -c option to compile object code for both files using gcc and
g++, then linking them together (I've trued using both gcc and g++ to
link the object code). However when I try the final link together I get
an error saying that there was an undefined reference to the C function
in the main function.
Here is the test code I have been using (I know there is no reason why
I can't compile them both as C or C++ but they are not the functions I
need to compile, only test ones. It makes sense to me. The final code I
create will involve RPC calls which I can only get working in C)
//C++ main function called main.cc
extern void funky(void);
void main()
{
funky();
};
//C function called funky.c
void funky()
{
int x;
x = 0;
};
The commands I used were
g++ -c main.cc
gcc -c funky.c
g++ main.o funky.o -o prog
I am sorry to bother you with this question but I don't know who else
to try, even my leactures at university don't know how to achieve this.
- --
John, My reality check just bounced.
------------------------------
From: "Blinston S. Fernandes" <[EMAIL PROTECTED]>
Date: Fri, 9 Apr 1999 19:33:31 -0500 (GMT)
Subject: Re: using a C function in a C++ program
you'll have to include the definition in ur c++ prog within the extern
statements braces ...
extern "C" {
extern void funky(void);
}
this is because C++ appends info redgarding the argument types to the fn
name, so that overloading and the likes can be performed. this is called
name mangling if u want the correct terms. by using the extern "C" you
tell the compiler to cut the name mangling from your fn as it has been
compiled externally from the C++ compiler, and thus has no such info.
regarding the argument types.
On Fri, 9 Apr 1999, John wrote:
> I have been trying for a couple of weeks now to compile a program that
> consists of a C++ main function which calls a C function. I have tried
> using the -c option to compile object code for both files using gcc and
> g++, then linking them together (I've trued using both gcc and g++ to
> link the object code). However when I try the final link together I get
> an error saying that there was an undefined reference to the C function
> in the main function.
>
> Here is the test code I have been using (I know there is no reason why
> I can't compile them both as C or C++ but they are not the functions I
> need to compile, only test ones. It makes sense to me. The final code I
> create will involve RPC calls which I can only get working in C)
>
> //C++ main function called main.cc
> extern void funky(void);
>
> void main()
> {
> funky();
> };
>
> //C function called funky.c
> void funky()
> {
> int x;
> x = 0;
> };
>
>
> The commands I used were
> g++ -c main.cc
> gcc -c funky.c
> g++ main.o funky.o -o prog
>
> I am sorry to bother you with this question but I don't know who else
> to try, even my leactures at university don't know how to achieve this.
> --
> John, My reality check just bounced.
>
>
>
####################################################
# Blinston S. Fernandes eMail:[EMAIL PROTECTED] #
# System Software Development Group #
# Centre for Development of Advanced Computing #
# 2/1 Ramanashree Plaza #
# Bangalore 560 025 #
# India #
# Tel: 91-080-5584271/982/143 ext:310 #
# Fax: 91-080-5584893 # b2
############################################### **
------------------------------
From: Chris Jester <[EMAIL PROTECTED]>
Date: Fri, 9 Apr 1999 12:01:47 -0700
Subject: Re: using a C function in a C++ program
You might want to try prototyping the C funct. BEFORE it is called.
This worked for me when I had the same probs.
At 6:08 AM -0700 4/9/99, John wrote:
>I have been trying for a couple of weeks now to compile a program that
>consists of a C++ main function which calls a C function. I have tried
>using the -c option to compile object code for both files using gcc and
>g++, then linking them together (I've trued using both gcc and g++ to
>link the object code). However when I try the final link together I get
>an error saying that there was an undefined reference to the C function
>in the main function.
>
>Here is the test code I have been using (I know there is no reason why
>I can't compile them both as C or C++ but they are not the functions I
>need to compile, only test ones. It makes sense to me. The final code I
>create will involve RPC calls which I can only get working in C)
>
>//C++ main function called main.cc
>extern void funky(void);
>
>void main()
>{
> funky();
>};
>
>//C function called funky.c
>void funky()
>{
> int x;
> x = 0;
>};
>
>
>The commands I used were
>g++ -c main.cc
>gcc -c funky.c
>g++ main.o funky.o -o prog
>
>I am sorry to bother you with this question but I don't know who else
>to try, even my leactures at university don't know how to achieve this.
>--
>John, My reality check just bounced.
****** PLEASE NOTE *******
OUR NEW ADDRESS AND TELEPHONE NUMBER:
SplitInfinity
13553 Poway Rd. #1504
Poway, CA 92064
U.S.A.
OUR NEW PHONE NUMBER: 619-679-2814
All items should be mailed to this address from this moment forward.
Thank you.
Chris Jester
SplitInfinity
------------------------------
From: Slava Chernobai <[EMAIL PROTECTED]>
Date: Fri, 9 Apr 1999 23:24:36 +0400
Subject: gcc -shared
Hi.
I have such problem:
$ gcc -fPIC -o foo.o foo.c
$ gcc -shared -o libfoo.so libfoo.o
$ ldd -r libfoo.so
statically linked
undefined symbol: printf ()
...
Program, that uses libfoo's functions linked against libc.so.6.
It works well.
libfoo uses printf (and other functions) from libc, but gcc doesn't
link shared libraries against libc.so.6 by default.
Question. Does shared library needs to be linked against the libraries,
functions from it uses?
- --
Slava
mailto:[EMAIL PROTECTED]
------------------------------
From: [EMAIL PROTECTED] (Aaron M. Ucko)
Date: 09 Apr 1999 17:07:44 -0400
Subject: Re: gcc -shared
Slava Chernobai <[EMAIL PROTECTED]> writes:
> Question. Does shared library needs to be linked against the libraries,
> functions from it uses?
That's not necessary, but it is a good idea, especially if you want
people to be able to use your library on machines with multiple
incompatible versions of libraries on which it depends (for instance
libc5 and libc6/glibc2)
- --
Aaron M. Ucko, KB1CJC <[EMAIL PROTECTED]> (finger [EMAIL PROTECTED])
------------------------------
From: [EMAIL PROTECTED]
Date: Fri, 09 Apr 1999 19:12:09 ric
Subject: Re: gcc -shared
If libfoo.so might be used by/useful to a program written in some other
language, it would be kind of the library developer to link libfoo.so
with -lc. This just adds the soname libc.so.6 so ld and ld.so know how
to resolve lobfoo.so's references. I think in general it is a good idea
for a shared library to be linked with any other shared library it
depends on.
There are other ways to work it, but this seems to me to be the most
straighforward.
Lawson
>< Microsoft free environment
This mail client runs on Wine. Your mileage may vary.
On Fri, 9 Apr 1999, Slava Chernobai wrote:
> Hi.
>
> I have such problem:
>
> $ gcc -fPIC -o foo.o foo.c
> $ gcc -shared -o libfoo.so libfoo.o
> $ ldd -r libfoo.so
> statically linked
> undefined symbol: printf ()
> ...
> Program, that uses libfoo's functions linked against libc.so.6.
> It works well.
>
> libfoo uses printf (and other functions) from libc, but gcc doesn't
> link shared libraries against libc.so.6 by default.
>
> Question. Does shared library needs to be linked against the libraries,
> functions from it uses?
>
> --
> Slava
> mailto:[EMAIL PROTECTED]
>
>
>
___________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com/getjuno.html
or call Juno at (800) 654-JUNO [654-5866]
------------------------------
From: Rodrigo Ferraz <[EMAIL PROTECTED]>
Date: Fri, 09 Apr 1999 22:32:19 -0300 (GMT+3)
Subject: Error while compiling glibc-2.1: undefined symbol: _dl_global_scope_end
Hello,
While compiling new glibc 2.1 i got this error:
gcc -nostdlib -nostartfiles -o rpcinfo -Wl,-dynamic-linker=/lib/ld-linux.so.2
../csu/crt1.o ../csu/crti.o `gcc --print-file-name=crtbegin.o` rpcinfo.o -Wl,-
rpath-link=..:../math:../elf:../nss:../nis:../db2:../rt:../resolv:../linuxthread
s ../libc.so.6 ../libc_nonshared.a -lgcc `gcc --print-file-name=crtend.o` ../csu
/crtn.o
../elf/ld-linux.so.2 --library-path ..:../math:../elf:../nss:../nis:../db2:../rt
:../resolv:../linuxthreads ./rpcgen -Y `gcc -print-file-name=cpp | sed "s|/cpp$|
|"` \
-c rpcsvc/bootparam.x -o xbootparam.T
./rpcgen: /lib/libc.so.6: no version information available (required by ./rpcgen
)
./rpcgen: /lib/libc.so.6: no version information available (required by ./rpcgen
)
./rpcgen: error in loading shared libraries: /lib/libc.so.6: undefined symbol: _
dl_global_scope_end
make[1]: *** [xbootparam.stmp] Error 127
make[1]: Leaving directory `/root/glibc-2.1/sunrpc'
make: *** [sunrpc/others] Error 2
The FAQ that comes with glibc-2.1 package says something about
versioning problems. Do i need to recompile rpcgen?? Another question: rpcgen
comes with binutils package, right? :-)
Thanks
------------------------------
From: Przemek Borys <[EMAIL PROTECTED]>
Date: Sat, 10 Apr 1999 00:46:25 +0200
Subject: sigsegv -- fixed ;)
EHLO!
I did it! :))) All works fine now.
It was all caused by a tiny bug -- a ptr[strlen(ptr)-1] assignment
without checking for the strlen value first :-Q
Anyway thanks for your help, I learned a bit about different debiggung
methods :)
- --
____\___\___
(_(\|,|_|,|_ Gassho! [http://dione.ids.pl/~pborys][mr MUA home]
| | |. [teksty o zen,programowaniu,moje sf,xfaq_pl, inne]
------------------------------
From: Falcon <[EMAIL PROTECTED]>
Date: Tue, 13 Apr 1999 22:35:26 -0300
Subject: Error while compiling glibc-2.1: undefined symbol: _dl_global_scope_end
- -----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello,
While compiling new glibc 2.1 i got this error:
gcc -nostdlib -nostartfiles -o rpcinfo -Wl,-dynamic-linker=/lib/ld-linux.so.2
../csu/crt1.o ../csu/crti.o `gcc --print-file-name=crtbegin.o` rpcinfo.o
- - -Wl,-
rpath-link=..:../math:../elf:../nss:../nis:../db2:../rt:../resolv:../linuxth
read
s ../libc.so.6 ../libc_nonshared.a -lgcc `gcc --print-file-name=crtend.o`
../csu
/crtn.o
../elf/ld-linux.so.2 --library-path
..:../math:../elf:../nss:../nis:../db2:../rt
:../resolv:../linuxthreads ./rpcgen -Y `gcc -print-file-name=cpp | sed
"s|/cpp$|
|"` \
-c rpcsvc/bootparam.x -o xbootparam.T
./rpcgen: /lib/libc.so.6: no version information available (required by
./rpcgen
)
./rpcgen: /lib/libc.so.6: no version information available (required by
./rpcgen
)
./rpcgen: error in loading shared libraries: /lib/libc.so.6: undefined
symbol: _
dl_global_scope_end
make[1]: *** [xbootparam.stmp] Error 127
make[1]: Leaving directory `/root/glibc-2.1/sunrpc'
make: *** [sunrpc/others] Error 2
The FAQ that comes with glibc-2.1 package says something about
versioning problems. Do i need to recompile rpcgen?? Another question: rpcgen
comes with binutils package, right? :-)
Thanks
My tools: gcc-2.8.1 and the latest binutils release (when it was still
available at sunsite!).
My situation: upgrading glibc-2.0.6.
- - --
Falcon <[EMAIL PROTECTED]> UIN: 5036612
Protheus Org. - Porto Alegre - RS
URL: http://www.protheus.org
Phone/Fax: +55-51-3407370
PGP Key available at http://www.protheus.org/falcon-pgp.key
PGP FP: F9EF 3646 C4C4 8F8A 2BE6 9B77 209D 5CCF 51AC B049
PGP ID: 0x51ACB049
- -----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.0.2i
iQA/AwUBNxPw3GlnSqO3hq84EQJssgCgpnoKvj6GuWVoYwiAgRiSPlkybj0An1rD
amCUGm2368fQP74ffhgP0jcq
=EBv3
- -----END PGP SIGNATURE-----
------------------------------
From: [EMAIL PROTECTED]
Date: Wed, 14 Apr 1999 23:08:24 -0500 (CDT)
Subject: CSE bug ??
Hi, I think I am tracking a bug in egcs that appears not to
exist in gcc. Its a little beyond my abilities to solve, so
I am not sure how to ask for help.
I am compiling a routine that manipulates strings (actually, vsprintf,
from the linux kernel). It looks something like this:
void vsprintf (... char *ptr ... ) {
...
while (...) {
++ptr;
...
if ('%' == *ptr) ...
}
}
where ... == dozens of lines of code. The compiler appears to be
generating code that 'forgets' that the ptr was incremented back
when, and pulls an old, unincremented value out of the stack.
(Alternately, it forgot to write the new value back into the stack...)
I can make the bug go away by modifying as follows:
void vsprintf (... char *aaaptr ... ) {
char * ptr = aaaptr;
...}
and then everything works right ...
>From what I can tell, this bug occurs in egcs-1.1.1 and 1.1.2 but not gcc-2.8.1
(when compiled with -O2) (although I'm still checking). The back end is
the i370 back end which is identical for egcs and gcc. So I figure the back
end must not be at fault :-) And of course, linux vsprintf is known to work ...
so it would appear to be something funky that the optimizer is doing.
Anyone care to help me crack this?
- --linas
------------------------------
From: "Martin v. Loewis" <[EMAIL PROTECTED]>
Date: Thu, 15 Apr 1999 08:16:28 +0200
Subject: Re: CSE bug ??
> Anyone care to help me crack this?
What you should do is write a bug report to
[EMAIL PROTECTED] Make sure it is 'complete', according to
the 'reporting bugs' section of gcc.info. In this case, provide
original source (preprocessed), assembler output, and an indication of
why you think the assembler output is incorrect.
If you want to analyse it yourself: invoke cc1 with -da, and look at
the various RTL dumps produced.
Hope this helps,
Martin
------------------------------
From: Fenglou Mao <[EMAIL PROTECTED]>
Date: Fri, 16 Apr 1999 15:08:09 -0700 (PDT)
Subject: stl debug
Dear all,
I found it was very difficult to debug stl, for example, I can not
print a value like this:
vector<Object>::iterator i;
>>print *i
>>print (*i).value
The commands before are all error in dbx(SGI).
Do someone has good suggestion?
Sincerely Yours,
FengLou Mao
*******************************
ADD:Mr. FengLou Mao
Peking University
BeiJing
P.R.China
Tel:86-10-62751490
Fax:86-10-62751725
------------------------------
From: Falcon <[EMAIL PROTECTED]>
Date: Tue, 20 Apr 1999 04:19:38 -0300 (GMT+3)
Subject: undefined symbol while compiling glibc-2.1
Well, i'm sending mail to this list because GNATS at GNU website is
"Out of Order", i couldn't find information about this problem searching
through the net, i already looked at the FAQ that comes with the package
dozens of times, i already reinstalled binutils, ld.so, and egcs too, and, i'm
a little "green" with C programming. *<8-)
I guess this problem is related to ld.so, but i'm not really sure.
The problem: while compiling glibc-2.1 i got this "undefined
symbol" error:
make[1]: Entering directory `/root/glibc-2.1/sunrpc'
../elf/ld-linux.so.2 --library-path
..:../math:../elf:../nss:../nis:../db2:../rt:../resolv:../linuxthreads ./rpcgen
- -Y `gcc -print-file-name=cpp | sed "s|/cpp$||"` \
-c rpcsvc/bootparam.x -o xbootparam.T
./rpcgen: /lib/libc.so.6: no version information available (required by
./rpcgen)
./rpcgen: /lib/libc.so.6: no version information available (required by
./rpcgen)
./rpcgen: error in loading shared libraries: /lib/libc.so.6: undefined symbol:
_dl_global_scope_end
make[1]: *** [xbootparam.stmp] Error 127
make[1]: Leaving directory `/root/glibc-2.1/sunrpc'
make: *** [sunrpc/others] Error 2
The situation: upgrading from glibc-2.0.6.
The tools present (well, the last set tried! :^)): egcs-1.1.2 release,
binutils-2.9.1.0.19, ld.so-1.9.9, glibc-2.0.6
Fragment from "nm" output:
U _dl_check_all_versions@@GLIBC_2.0
000d218c T _dl_close
U _dl_debug_impcalls@@GLIBC_2.0
U _dl_debug_initialize@@GLIBC_2.0
U _dl_debug_message@@GLIBC_2.0
U _dl_debug_state@@GLIBC_2.0
U _dl_fpu_control@@GLIBC_2.1
U _dl_global_scope_alloc@@GLIBC_2.1
U _dl_init_next@@GLIBC_2.0
U _dl_initial_searchlist@@GLIBC_2.1
000e3268 d _dl_load_lock
U _dl_loaded@@GLIBC_2.1
U _dl_lookup_symbol@@GLIBC_2.0
U _dl_main_searchlist@@GLIBC_2.1
As you see, lots of UNDEFINED symbols...
------------------------------
From: [EMAIL PROTECTED] (H.J. Lu)
Date: Thu, 22 Apr 1999 09:30:35 -0700 (PDT)
Subject: binutils 2.9.1.0.24 is released.
Please give it a try.
Thanks.
- --
H.J. Lu ([EMAIL PROTECTED])
- --
This should be final release for binutils 2.9.1.0.x based on binutils
2.9.1. I am planning to release to public this weekend. Please test it
as much as you can. Thanks.
This is the beta release of binutils 2.9.1.0.24 for Linux, which is
based on binutils 2.9.1 plus Linux/ARM support, some x86 assembler
changes, some PPC bug fixes, some alpha bug fixes and an exception
frame optimization bug fix.
Due to the exception frame optimization bug fix, it is highly
recommended that you recompile all your C++ codes. Otherwise,
exception handling may not work right when an exception is thrown.
Since I no longer have machine running libc 5, starting from this
release, there will be no pre-compiled binaries for libc 5.
There was some problem on Linux/alpha. The binaries generated by the
new binituls may not run correctly on Linux/alpha. It turned out it was
a bug in the alpha dynamic linker in glibc 2.0.6. The current glibc 2.1
and glibc 2.0.7 should be ok.
This release should work on linux/x86/alpha. There are some ELF bug
fixes. But I don't know if it fixes all the bugs reported on
linux/sparc, Linux/MIPS and linux/PPC. I'd like to hear reports on them.
I'd like to release it to public soon. Please test it as much as you
can.
Please report any bugs related to binutils 2.9.1.0.24 to [EMAIL PROTECTED]
Changes from binutils 2.9.1.0.23:
1. Fix a Sparc asm bug.
2. Fix an i370 BFD typo.
3. Fix an alpha asm bug.
4. Fix a PPC bug.
5. Fix an objcopy bug.
Changes from binutils 2.9.1.0.22:
1. Fix i386 disassembler for fwait.
2. Add "-j section" for objcopy.
3. Bug fix for linker. It should work for Linux/PPC now.
4. Add armlinux_vec for ARM/ELF.
5. Update gas documation for i386.
2. Fix an i370 BFD typo.
3. Fix an alpha asm bug.
4. Fix a PPC bug.
5. Fix an objcopy bug.
6. Bug fixes for Sparc/ELF.
7. Bug fixes for IBM 370.
8. Added gas documation for IBM 370.
Changes from binutils 2.9.1.0.21:
1. Add Pentium III support.
2. Add IBM 370 suppport.
3. Fix the weak undefined symbol handling.
Changes from binutils 2.9.1.0.20:
1. Ada demangle support.
2. Don't merge weak undefined symols with definitions from a shared
object when building shared object. Only for ELF.
3. Fix a 16bit x86 gas bug.
Changes from binutils 2.9.1.0.19a:
1. Enable ld for Solaris/x86.
2. Fix an ELF/i386 bfd/linker bug.
3. Fix a BFD bug.
4. Fix the ELF aligment.
5. Fix an AMD 3DNow! bug.
6. Fix ELF/x86 8/16-bit relocation bug.
7. Add --redefine-sym=old_form=new_form to objcopy.
8. Update cplus-dem.c from the egcs snapshot.
9. Support new Pentium II instructions.
10. Add --demangle/--no-demangle to ld.
Changes from binutils 2.9.1.0.21:
1. A PPC DWARF2 EH patch for gas.
Changes from binutils 2.9.1.0.19:
1. Allow '.' in the middle of a symbol name for the versioning script.
Changes from binutils 2.9.1.0.17:
1. An ELF bug fix.
Changes from binutils 2.9.1.0.16:
1. Some Linux/Sparc64 patches.
2. A shared library linking patch.
3. Update cplus-dem.c from egcs 1.1.1 release.
Changes from binutils 2.9.1.0.15:
1. Update cplus-dem.c from egcs 1.1.1 prerelease.
2. Fix ARM bugs.
3. Fix MIPS/ELF bugs.
4. Fix an objdump bug.
Changes from binutils 2.9.1.0.14:
1. Update the program header handling bug fix from the binutils
snapshot.
2. Added AMD 3DNow! support to disassembler.
Changes from binutils 2.9.1.0.13:
1. An ELF bug fix for program header handling.
2. Added AMD 3DNow! support.
3. Add some vxworks suppport.
4. Fix ld on none-linux platforms.
Changes from binutils 2.9.1.0.12:
1. An ELF/alpha bug fix for creating large shared libraries.
2. An ELF/PPC bug fix.
Changes from binutils 2.9.1.0.11:
1. Use the real fix from Ian for the exception frame optimization bug.
Changes from binutils 2.9.1.0.10:
1. Fix an exception frame optimization bug.
Changes from binutils 2.9.1.0.9:
1. Fix another -Bsymbolic bug for Linux/alpha.
Changes from binutils 2.9.1.0.7:
1. Fix -Bsymbolic for Linux/alpha.
2. Fix a 16bit x86 gas bug.
Changes from binutils 2.9.1.0.6:
1. Fix various ARM bugs.
Changes from binutils 2.9.1.0.5:
1. A MIPS assembler ".align" bug is fixed.
2. bfd.h, bfd.h and bfdlink.h are included in the binary package.
Changes from binutils 2.9.1.0.4:
1. 2 x86 16bit mode assembler bugs, "ret" and "movb $35,0x4(%di)", are
fixed.
IMPORTANT:
The .plt format that the Alpha was using was not thread safe. So I
changed it. The new format is *not* binary compatible with the old,
thus you must use glibc 2.0.4 to get an ld.so that can understand it.
Note that the new ld.so knows how to deal with the old .plt format, so
old libraries will still work, but they should be relinked eventually
for performance reasons.
The file list:
1. binutils-2.9.1.0.24.tar.gz. Source code.
2. binutils-2.9.1.0.23-2.9.1.0.24.diff.gz. Patch against the previous
beta source code.
3. binutils-2.9.1.0.24-glibc.x86.tar.gz. Precompiled Linux/x86 binaries
for libc 6 (glibc 2.0.7 1998-12-11 or above).
4. binutils-2.9.1.0.24-alpha.tar.gz. Precompiled Linux/alpha binaries
for glibc 2.0.7 1998-12-11 or above.
5. binutils.spec. A RPM spec file for RedHat 5.2.
The primary ftp sites for the Linux binutils are:
1. ftp://ftp.varesearch.com/pub/support/hjl/binutils
2. ftp://ftp.kernel.org/pub/linux/devel/gcc
The beta directory is in private/tofu under the GCC directory.
To install the binary package, please follow the procedure very closely.
Please backup/save all the files you are instructed to delete and you
should do
gzip -dc binutils-2.9.1.0.24-glibc.x86.tar.gz | tar tvvf -
or
gzip -dc binutils-2.9.1.0.24-alpha.tar.gz | tar tvvf -
to see what is in there.
Please do back up before you remove things.
To install for libc 6 (glibc 2.0.7 1998-12-11 or above), PLEASE DO
1. su root
2. cd /
3. rm -f /usr/bin/encaps /usr/bin/nm
4. gzip -dc binutils-2.9.1.0.24-glibc.x86.tar.gz | tar xvvf -
5. ldconfig
Now you have the new gas/binutils under /usr/bin and
/usr/ix86-linuxaout/bin. You have to use
/usr/ix86-linuxaout/bin/as
and
/usr/ix86-linuxaout/bin/ld -m i386linux
if you want to use a.out as and ld directly.
To install for alpha, PLEASE DO
1. su root
2. cd /
3. gzip -dc binutils-2.9.1.0.24-alpha.tar.gz | tar xvvf -
4. ldconfig
I have changed the target names for Linux/x86 and Linux/x86 (a.out)
to ix86-linux and ix86-linuxaout respectively. The precompiled
binaries are installed under /usr/ix86-linux and /usr/ix86-linuxaout.
You should make appropriate symbolic links if you have a different
name for the Linux/x86 target, like i586-unknown-linux.
The target name for Linux/alpha is alpha-linux. The precompiled alpha
binaries are installed under /usr/alpha-linux. You should make
appropriate symbolic links if you have a different name for the
Linux/alpha target, like alpha-redhat-linux.
If you have an old linux library in the a.out format and you cannot
obtain the newer version in the ELF format for whatever reason, you
can try "objcopy --remove-leading-char" on the a.out library and see
if it can link with your code in ELF.
Thanks.
H.J. Lu
[EMAIL PROTECTED]
04/21/99
------------------------------
From: "Aniruddha Bohra" <[EMAIL PROTECTED]>
Date: Sun, 18 Apr 1999 10:47:33 +0530
Subject: Compilation problems
Hello,
I have been trying to compile userfs on 2.0.36 but have been unable to .
This is an emergency so anyone who can please provide with the binaries
kindly do so..
Thanks
Aniruddha
------------------------------
From: Linas Vepstas <[EMAIL PROTECTED]>
Date: Mon, 26 Apr 1999 01:06:32 -0500
Subject: REL vs. RELA, .got .plt etc.
What's the best/easiest to understand what the different between
REL and RELA is in the binutils bfd, and also how people implement
.got and .plt sections? Neither the gas info docs, nor the bfd info
docs seem to cover these topics.
I am trying to compile glibc on a new architecture (ES/390) and
get a linker core dump when building ld.so This seems to be somehow
realted with the dynamic-linking code which is currently stubbed out;
I can't figure out what I need & don't need to do.
BTW, Since the ES/390 architecture only has 12-bit addresses, it
can't directly address anything outside of a 4K page. Any wise
words on how this might affect the dynamic linker design?
- -linas
------------------------------
From: [EMAIL PROTECTED]
Date: Tue, 27 Apr 1999 01:51:35 +1000
Subject: ld.so, libdl
Hi,
I want to override a weak symbol in a dlopen()ed object with one whose value
is calculated on the fly by the main-line executable.
I don't see any easy way to define a new symbol in the executable's symtab, so
I'm left with the necessity of generating a linkable object, dlopen()ing it
first, and having the synthesised symbol definition override the weak one.
Any comments or hints would be welcome
Colin.
------------------------------
From: Linas Vepstas <[EMAIL PROTECTED]>
Date: Tue, 27 Apr 1999 11:02:17 -0500
Subject: ES/390 gcc/egcs optimizations
A couple of quickie questions:
I'm working on the i370 back end to the egcs compiler.
I want to make all loads of registers occur well before they are
referenced, and in particular, well before they are referenced
as base registers.
i.e. in c programs that write a->b I want to move other
instructions into the gap between when a is fetched & a is used to
fetch b,
Unlike risc machines & almost everything else out there, it
seems a->b needs more pipeline cycles than e.g. (a+b) or even
if(a>=b) oddly enough, unlike traditional riscs, there's no
branch penalty, but there's a huge dereference penalty.
Nother "quickie" question:
I have to generate different instructions depending on whether
my branch target is more than 4K bytes away. Of course, I don't
know how far away until I've gotten further in the compilation.
What's the best way to deal with this? (I was thinking of compiling
into a temp buffer & then pasting that buffer to output when done)
- --linas
------------------------------
From: [EMAIL PROTECTED]
Date: Wed, 28 Apr 1999 12:19:21 -0400
Subject: changing embedded RPATH in existing executables.
Hello,
I would like to be able to change the embedded rpath in executable and
shared libraries using libbfd. The development platform in question here
is linux/i386.
[ I was also thinking of using something similar (presuming it's possible)
to change the NEEDED tags for redhat glibc-2.1 built executables so that
they can be run on non-redhat glibc-2.1 distributions. Redhat 6.0 has
used a different SONAME for it's glibc-2.1 built libstdc++.so.2.9.0 then
any of the other glibc-2.1distributions, so ISVs and other external package
creators will have to build separate executables/packages for redhat
glibc-2.1 and for any other glibc-2.1 based distributions if they use C++.
The other possibilty would be for everybody to ship their own libstdc++
(and use -Wl,-rpath to force it to be used instead of the system one) so
that their binaries will work on different distributions. However, I am
not sure this is feasable because of the GPL. ]
Based on objdump, and some of the libbfd elf code I wrote the program below
that can be used to find the RPATH start in the ELF .dynamic section, but
now that I have found it I don't know how to write modifications back into
the section. I tried bfd_openw instead of bfd_openr, but the code to find
the RPATH doesn't work after doing that (the bfd_check_format_matches call
fails).
Can anybody provide me with some hints for the next step.
Peeter
- --
#include "bfd.h"
#include <stdlib.h>
#include <stdio.h>
#include "sysdep.h"
#include "bfdlink.h"
#include "libbfd.h"
#define ARCH_SIZE 0
#include "elf-bfd.h"
int main (int argc, char **argv)
{
bfd *file;
char **matching;
asection *s;
bfd_init ();
if (argc != 2)
abort();
file = bfd_openr (argv[1], "elf32-i386");
if (!file)
abort();
#if 0
if (!bfd_set_format(file, bfd_object))
abort();
#endif
if (!bfd_check_format_matches (file, bfd_object, &matching))
abort();
s = bfd_get_section_by_name (file, ".dynamic");
if (s != NULL)
{
int elfsec;
unsigned long link;
bfd_byte *extdyn, *extdynend;
size_t extdynsize;
void (*swap_dyn_in) PARAMS ((bfd *, const PTR, Elf_Internal_Dyn *));
bfd_byte *dynbuf = NULL;
dynbuf = (bfd_byte *) bfd_malloc (s->_raw_size);
if (dynbuf == NULL)
abort();
if (! bfd_get_section_contents (file, s, (PTR) dynbuf, (file_ptr) 0,
s->_raw_size))
abort();
elfsec = _bfd_elf_section_from_bfd_section (file, s);
if (elfsec == -1)
abort();
link = elf_elfsections (file)[elfsec]->sh_link;
extdynsize = get_elf_backend_data (file)->s->sizeof_dyn;
swap_dyn_in = get_elf_backend_data (file)->s->swap_dyn_in;
extdyn = dynbuf;
extdynend = extdyn + s->_raw_size;
for (; extdyn < extdynend; extdyn += extdynsize)
{
Elf_Internal_Dyn dyn;
const char * tag = NULL;
(*swap_dyn_in) (file, (PTR) extdyn, &dyn);
if (dyn.d_tag == DT_RPATH)
tag = "RPATH";
if (dyn.d_tag == DT_SONAME)
tag = "SONAME";
if (tag)
{
const char *string;
string = bfd_elf_string_from_elf_section (file, link,
dyn.d_un.d_val);
if (string == NULL)
abort();
printf ("%s:%s\n", tag, string);
// strcpy((char *)string, "x");
}
}
#if 0
{
bfd * out;
asection * snew;
out = bfd_create("out", file);
if (!out)
abort();
snew = bfd_get_section_by_name (out, ".dynamic"); // doesn't work
if (!snew)
abort();
if (! bfd_set_section_contents (out, snew, (PTR) dynbuf, (file_ptr)
0,
s->_raw_size))
abort();
bfd_close(out);
}
#endif
}
bfd_close (file);
return 0;
}
------------------------------
From: [EMAIL PROTECTED]
Date: Wed, 28 Apr 1999 23:59:39 ric
Subject: Re: changing embedded RPATH in existing executables.
The easiest way to do this is to make a new copy of the
executable/library, and change what you want changed while you are about
it. Bear in mind, though, that RedHat might have had a _reason_ for
changing the soname - possibly their libstdc++.so.2.9.0 is incompatible
in some way? I'd look in the patchfiles (They're included in the SRPM)
and see if they give or imply any reason any reason they changed it - at
least before distributing libraries with modified sonames. :-)
Lawson
>< Microsoft free environment
This mail client runs on Wine. Your mileage may vary.
On Wed, 28 Apr 1999 [EMAIL PROTECTED] wrote:
>
>
> Hello,
>
> I would like to be able to change the embedded rpath in executable and
> shared libraries using libbfd. The development platform in question
here
> is linux/i386.
>
> [ I was also thinking of using something similar (presuming it's
possible)
> to change the NEEDED tags for redhat glibc-2.1 built executables so
that
> they can be run on non-redhat glibc-2.1 distributions. Redhat 6.0 has
> used a different SONAME for it's glibc-2.1 built libstdc++.so.2.9.0
then
> any of the other glibc-2.1distributions, so ISVs and other external
package
> creators will have to build separate executables/packages for redhat
> glibc-2.1 and for any other glibc-2.1 based distributions if they use
C++.
> The other possibilty would be for everybody to ship their own libstdc++
> (and use -Wl,-rpath to force it to be used instead of the system one)
so
> that their binaries will work on different distributions. However, I
am
> not sure this is feasable because of the GPL. ]
>
> Based on objdump, and some of the libbfd elf code I wrote the program
below
> that can be used to find the RPATH start in the ELF .dynamic section,
but
> now that I have found it I don't know how to write modifications back
into
> the section. I tried bfd_openw instead of bfd_openr, but the code to
find
> the RPATH doesn't work after doing that (the bfd_check_format_matches
call
> fails).
>
> Can anybody provide me with some hints for the next step.
>
> Peeter
___________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com/getjuno.html
or call Juno at (800) 654-JUNO [654-5866]
------------------------------
From: "" <[EMAIL PROTECTED]>
Date: Thu, 29 Apr 1999 05:20:06 PDT
Subject: Help for password...
Hello,
I'm working on a programm which have to create useraccounts. The users
who want to have an account, must enter their name, etc... and their
password in a database (MySQL). Then the program analyse their demands
and, if it's good, create their accounts. Actually I use the commande
'useradd' in may program and I can't change the password dynamicly...
Have I choose the good solution with 'useradd'? else how can I do???
Thanks...
Fabien. ([EMAIL PROTECTED])
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
------------------------------
From: [EMAIL PROTECTED]
Date: Thu, 29 Apr 1999 14:58:43 ric
Subject: Re: Help for password...
You might want to look at newusers. Pay extra attention to the cautions
about protecting files that contain passwords, though.
Lawson
>< Microsoft free environment
This mail client runs on Wine. Your mileage may vary.
On Thu, 29 Apr 1999, wrote:
> Hello,
>
> I'm working on a programm which have to create useraccounts. The users
> who want to have an account, must enter their name, etc... and their
> password in a database (MySQL). Then the program analyse their demands
> and, if it's good, create their accounts. Actually I use the commande
> 'useradd' in may program and I can't change the password dynamicly...
> Have I choose the good solution with 'useradd'? else how can I do???
>
> Thanks...
>
> Fabien. ([EMAIL PROTECTED])
>
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com
>
________________________________________________________________
Get secure free e-mail that you don't need Web access to use
from Juno, the world's second largest online service.
Download your free software at http://www.juno.com/getit.b.html.
------------------------------
From: Geoff Keating <[EMAIL PROTECTED]>
Date: Thu, 29 Apr 1999 17:41:06 +1000
Subject: Re: changing embedded RPATH in existing executables.
> From: [EMAIL PROTECTED]
> I would like to be able to change the embedded rpath in executable and
> shared libraries using libbfd. The development platform in question here
> is linux/i386.
_Changing_ is a little tricky, but the attached program strips rpaths
from executables (I find it essential for debugging the binutils).
It's endian-dependent, if you want this for x86 you can just change
the occurrences of 'MSB' to 'LSB' and compile (I should really fix
that).
- --
Geoffrey Keating <[EMAIL PROTECTED]>
===File ~/src/killrpath.c===================================
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <elf.h>
#include <stdlib.h>
/* Reads an ELF file, nukes all the RPATH entries. */
int
main(int argc, char **argv)
{
int fd;
Elf32_Ehdr ehdr;
int i;
Elf32_Phdr phdr;
Elf32_Dyn *dyns;
int dynpos;
if (argc != 2)
{
printf ("Usage: %s objectfile\n", argv[0]);
return 1;
}
fd = open(argv[1], O_RDWR);
if (fd == -1)
{
perror ("open");
return 1;
}
if (read(fd, &ehdr, sizeof(ehdr)) != sizeof(ehdr))
{
perror ("reading header");
return 1;
}
if (*(unsigned *)ehdr.e_ident != *(const unsigned *)ELFMAG ||
ehdr.e_ident[EI_CLASS] != ELFCLASS32 ||
ehdr.e_ident[EI_DATA] != ELFDATA2MSB ||
ehdr.e_ident[EI_VERSION] != EV_CURRENT)
{
fprintf(stderr, "`%s' probably isn't a 32-bit MSB-first ELF file.\n",
argv[1]);
return 1;
}
if (ehdr.e_phentsize != sizeof(Elf32_Phdr))
{
fprintf(stderr, "section size was read as %d, not %d!\n",
ehdr.e_phentsize, sizeof(Elf32_Phdr));
return 1;
}
if (lseek(fd, ehdr.e_phoff, SEEK_SET) == -1)
{
perror ("positioning for sections");
return 1;
}
for (i = 0; i < ehdr.e_phnum; i++)
{
if (read(fd, &phdr, sizeof(phdr)) != sizeof(phdr))
{
perror ("reading section header");
return 1;
}
if (phdr.p_type == PT_DYNAMIC)
break;
}
if (i == ehdr.e_phnum)
{
fprintf (stderr, "No dynamic section found.\n");
return 2;
}
dyns = malloc(phdr.p_memsz);
if (dyns == NULL)
{
perror ("allocating memory for dynamic section");
return 1;
}
memset(dyns, 0, phdr.p_memsz);
if (lseek(fd, phdr.p_offset, SEEK_SET) == -1
|| read(fd, dyns, phdr.p_filesz) != phdr.p_filesz)
{
perror ("reading dynamic section");
return 1;
}
dynpos = 0;
for (i = 0; dyns[i].d_tag != DT_NULL; i++)
{
dyns[dynpos] = dyns[i];
if (dyns[i].d_tag != DT_RPATH)
dynpos++;
}
for (; dynpos < i; dynpos++)
dyns[dynpos].d_tag = DT_NULL;
if (lseek(fd, phdr.p_offset, SEEK_SET) == -1
|| write(fd, dyns, phdr.p_filesz) != phdr.p_filesz)
{
perror ("writing dynamic section");
return 1;
}
return 0;
}
============================================================
------------------------------
From: "Blinston S. Fernandes" <[EMAIL PROTECTED]>
Date: Fri, 30 Apr 1999 10:00:20 -0500 (GMT)
Subject: Re: Help for password...
How about making the entry into the password file directly. fopen(3S) it
directly and append your entry to it as it is a simple text file.
The password you have entered from the user (unencrypted) can be encrypted
using the crypt(3C) library function.
If you do this you can also think about using
alternative methods for generating the salt. gettimeofday(3C) is
traditional but you can also use alternatives like gethrtime(3C).
Invoking useradd and the likes may not be such a good idea. when you can
do the above. It is much simpler too !
On Thu, 29 Apr 1999, wrote:
> I'm working on a programm which have to create useraccounts. The users
> who want to have an account, must enter their name, etc... and their
> password in a database (MySQL). Then the program analyse their demands
> and, if it's good, create their accounts. Actually I use the commande
> 'useradd' in may program and I can't change the password dynamicly...
> Have I choose the good solution with 'useradd'? else how can I do???
>
####################################################
# Blinston S. Fernandes eMail:[EMAIL PROTECTED] #
# System Software Development Group #
# Centre for Development of Advanced Computing #
# 2/1 Ramanashree Plaza #
# Bangalore 560 025 #
# India #
# Tel: 91-080-5584271/982/143 ext:310 #
# Fax: 91-080-5584893 # b2
############################################### **
------------------------------
From: Ivan Eyara <[EMAIL PROTECTED]>
Date: Fri, 30 Apr 1999 08:58:06 +0000
Subject: RedHat upgrade
Hello everybody,
I upgraded my RedHat from version 5.0 to version 5.2 some days ago.
Everything seemed to be going fine but yesteday I found the problem.
I can't compile, link and run a application written in C that worked
correctly in the previous version. This is the log:
1) First time I tried to compile and link it after a few changes in its
code I got the link error: undefined reference to the function fmod().
This functions is called from a module I had not changed for months.
2) I changed the Makefile and compiled the application with -lm in order
to link libm library and the compilation/link was ok.
3) When I run this version I got a segmentation fault that I had never
got.
4) I thought that the problem could be in the new changes and after a
long time looking for the problem I decided to restore a previous
backup. This backups contains the original code and the orirginal
Makefile.
5) I tried to compile and link again and I got the same link error:
undefined reference to the function fmod().
6) I decided to compile and link this version in a RedHat 5.0 box and
the result is ok.
Any help?
Please, reply to my address. I'm not a member of the list.
Thanks in advance,
- --
Ivan Eyara [EMAIL PROTECTED]
Software development
ZUNIBAL,S.L. http://www.zunibal.com
------------------------------
From: AMITPRAKASH <[EMAIL PROTECTED]>
Date: Fri, 30 Apr 1999 16:32:24 +0530
Subject: RE: RedHat upgrade
Hi everybody,
I also upgraded my RedHat from version 5.0 to version 5.2 some days
ago.
After this mail I tried to compile my c programs.The program has been
compiled
but the executable is not running.
Suppose if a.out is the executable then on typing a.out I get the message:
bash: a.out :command not found.
Any help?
Thanks.
- -----Original Message-----
From: Ivan Eyara [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 30, 1999 2:28 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RedHat upgrade
Hello everybody,
I upgraded my RedHat from version 5.0 to version 5.2 some days ago.
Everything seemed to be going fine but yesteday I found the problem.
I can't compile, link and run a application written in C that worked
correctly in the previous version. This is the log:
1) First time I tried to compile and link it after a few changes in its
code I got the link error: undefined reference to the function fmod().
This functions is called from a module I had not changed for months.
2) I changed the Makefile and compiled the application with -lm in order
to link libm library and the compilation/link was ok.
3) When I run this version I got a segmentation fault that I had never
got.
4) I thought that the problem could be in the new changes and after a
long time looking for the problem I decided to restore a previous
backup. This backups contains the original code and the orirginal
Makefile.
5) I tried to compile and link again and I got the same link error:
undefined reference to the function fmod().
6) I decided to compile and link this version in a RedHat 5.0 box and
the result is ok.
Any help?
Please, reply to my address. I'm not a member of the list.
Thanks in advance,
- --
Ivan Eyara [EMAIL PROTECTED]
Software development
ZUNIBAL,S.L. http://www.zunibal.com
- -====---====---====---====---====---====---====---====---====---====---====-
to unsubscribe email "unsubscribe linux-admin" to
[EMAIL PROTECTED]
See the linux-admin FAQ: http://www.kalug.lug.net/linux-admin-FAQ/
------------------------------
From: "Mark H. Wood" <[EMAIL PROTECTED]>
Date: Fri, 30 Apr 1999 08:17:11 -0500 (EST)
Subject: Re: Help for password...
On Fri, 30 Apr 1999, Blinston S. Fernandes wrote:
> How about making the entry into the password file directly. fopen(3S) it
> directly and append your entry to it as it is a simple text file.
>
> The password you have entered from the user (unencrypted) can be encrypted
> using the crypt(3C) library function.
> If you do this you can also think about using
> alternative methods for generating the salt. gettimeofday(3C) is
> traditional but you can also use alternatives like gethrtime(3C).
>
> Invoking useradd and the likes may not be such a good idea. when you can
> do the above. It is much simpler too !
And it breaks all to pieces on a system using shadow passwords or PAM.
- --
Mark H. Wood, Lead System Programmer [EMAIL PROTECTED]
Specializing in unusual perspectives for more than twenty years.
------------------------------
From: Joseph Keen <[EMAIL PROTECTED]>
Date: Fri, 30 Apr 1999 10:07:05 -0400 (EDT)
Subject: RE: RedHat upgrade
In 5.2 . isn't in your path as default. This is a nice little securty
measure but it does mean that you have to type ./a.out. Also check to see
if it has execute permission and run file on it to see if it is and
executable file.
> Hi everybody,
> I also upgraded my RedHat from version 5.0 to version 5.2 some days
> ago.
> After this mail I tried to compile my c programs.The program has been
> compiled
> but the executable is not running.
> Suppose if a.out is the executable then on typing a.out I get the message:
> bash: a.out :command not found.
> Any help?
> Thanks.
> -----Original Message-----
> From: Ivan Eyara [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 30, 1999 2:28 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
> [EMAIL PROTECTED]
> Subject: RedHat upgrade
>
>
> Hello everybody,
>
> I upgraded my RedHat from version 5.0 to version 5.2 some days ago.
> Everything seemed to be going fine but yesteday I found the problem.
>
> I can't compile, link and run a application written in C that worked
> correctly in the previous version. This is the log:
>
> 1) First time I tried to compile and link it after a few changes in its
> code I got the link error: undefined reference to the function fmod().
> This functions is called from a module I had not changed for months.
>
> 2) I changed the Makefile and compiled the application with -lm in order
> to link libm library and the compilation/link was ok.
>
> 3) When I run this version I got a segmentation fault that I had never
> got.
>
> 4) I thought that the problem could be in the new changes and after a
> long time looking for the problem I decided to restore a previous
> backup. This backups contains the original code and the orirginal
> Makefile.
>
> 5) I tried to compile and link again and I got the same link error:
> undefined reference to the function fmod().
>
> 6) I decided to compile and link this version in a RedHat 5.0 box and
> the result is ok.
>
> Any help?
>
> Please, reply to my address. I'm not a member of the list.
> Thanks in advance,
> --
> Ivan Eyara [EMAIL PROTECTED]
> Software development
> ZUNIBAL,S.L. http://www.zunibal.com
> -====---====---====---====---====---====---====---====---====---====---====-
> to unsubscribe email "unsubscribe linux-admin" to
> [EMAIL PROTECTED]
> See the linux-admin FAQ: http://www.kalug.lug.net/linux-admin-FAQ/
> -====---====---====---====---====---====---====---====---====---====---====-
> to unsubscribe email "unsubscribe linux-admin" to [EMAIL PROTECTED]
> See the linux-admin FAQ: http://www.kalug.lug.net/linux-admin-FAQ/
>
------------------------------
From: Bill Bond <[EMAIL PROTECTED]>
Date: Fri, 30 Apr 1999 10:37:03 -0700 (PDT)
Subject: [none]
"No gates, no windows, ... it's open!"
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
------------------------------
From: <[EMAIL PROTECTED]> (peeter joot)
Date: Fri, 30 Apr 1999 16:14:44 -0400 (EDT)
Subject: Re: changing embedded RPATH in existing executables.
> _Changing_ is a little tricky, but the attached program strips rpaths
> from executables (I find it essential for debugging the binutils).
> It's endian-dependent, if you want this for x86 you can just change
> the occurrences of 'MSB' to 'LSB' and compile (I should really fix
> that).
Hi Geoff,
With your program as a guide (and some peeks into libbfd, elf.h, a bit
of the glibc dynamic loader code, objdump, and a hex-editor) I was able to
figure out enough to find and change the rpath string. That was fun!
This program assumes (unlike your original program) that there is only
one DT_RPATH tag in the dynamic section as even with multiple '-Wl,-rpath,'
commands in the link this seems to occur (they all get concatonated into
a : separated path).
Thanks for your help. If you want to use this on non-x86 you have to change
the occurances of LSB back to MSB:)
Peeter
- --
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <elf.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
/* Reads an ELF file, and reads or alters the RPATH setting. */
int
main(int argc, char **argv)
{
int fd;
Elf32_Ehdr ehdr;
int i;
Elf32_Phdr phdr;
Elf32_Shdr shdr;
Elf32_Dyn *dyns;
int rpathoff;
char * strtab;
char * rpath;
int rpathlen;
int oflags;
if (argc != 2 && argc != 3)
{
printf ("Usage: %s objectfile [newrpath]\n", argv[0]);
return 1;
}
if (argc == 2)
oflags = O_RDONLY;
else
oflags = O_RDWR;
fd = open(argv[1], oflags);
if (fd == -1)
{
perror ("open");
return 1;
}
if (read(fd, &ehdr, sizeof(ehdr)) != sizeof(ehdr))
{
perror ("reading header");
return 1;
}
if (*(unsigned *)ehdr.e_ident != *(const unsigned *)ELFMAG ||
ehdr.e_ident[EI_CLASS] != ELFCLASS32 ||
ehdr.e_ident[EI_DATA] != ELFDATA2LSB ||
ehdr.e_ident[EI_VERSION] != EV_CURRENT)
{
fprintf(stderr, "`%s' probably isn't a 32-bit LSB-first ELF file.\n",
argv[1]);
return 1;
}
if (ehdr.e_phentsize != sizeof(Elf32_Phdr))
{
fprintf(stderr, "section size was read as %d, not %d!\n",
ehdr.e_phentsize, sizeof(Elf32_Phdr));
return 1;
}
if (lseek(fd, ehdr.e_phoff, SEEK_SET) == -1)
{
perror ("positioning for sections");
return 1;
}
for (i = 0; i < ehdr.e_phnum; i++)
{
if (read(fd, &phdr, sizeof(phdr)) != sizeof(phdr))
{
perror ("reading section header");
return 1;
}
if (phdr.p_type == PT_DYNAMIC)
break;
}
if (i == ehdr.e_phnum)
{
fprintf (stderr, "No dynamic section found.\n");
return 2;
}
dyns = malloc(phdr.p_memsz);
if (dyns == NULL)
{
perror ("allocating memory for dynamic section");
return 1;
}
memset(dyns, 0, phdr.p_memsz);
if (lseek(fd, phdr.p_offset, SEEK_SET) == -1
|| read(fd, dyns, phdr.p_filesz) != phdr.p_filesz)
{
perror ("reading dynamic section");
return 1;
}
rpathoff = -1;
for (i = 0; dyns[i].d_tag != DT_NULL; i++)
{
if (dyns[i].d_tag == DT_RPATH)
{
rpathoff = dyns[i].d_un.d_ptr;
break;
}
}
if (rpathoff == -1)
{
fprintf (stderr, "No rpath tag found.\n");
return 2;
}
if (lseek(fd, ehdr.e_shoff, SEEK_SET) == -1)
{
perror ("positioning for sections");
return 1;
}
for (i = 0; i < ehdr.e_shnum; i++)
{
if (read(fd, &shdr, sizeof(shdr)) != sizeof(shdr))
{
perror ("reading section header");
return 1;
}
if (shdr.sh_type == SHT_STRTAB)
break;
}
if (i == ehdr.e_shnum)
{
fprintf (stderr, "No string table found.\n");
return 2;
}
strtab = (char *)malloc(shdr.sh_size);
if (strtab == NULL)
{
perror ("allocating memory for string table");
return 1;
}
memset(strtab, 0, shdr.sh_size);
if (lseek(fd, shdr.sh_offset, SEEK_SET) == -1)
{
perror ("positioning for string table");
return 1;
}
if (read(fd, strtab, shdr.sh_size) != shdr.sh_size)
{
perror ("reading string table");
return 1;
}
if (shdr.sh_size < rpathoff)
{
fprintf(stderr, "RPATH string offset not contained in string table");
return 5;
}
rpath = strtab+rpathoff;
printf("%s:existing RPATH: %s\n", argv[1], rpath);
if (argc == 2)
return 0;
rpathlen = strlen(rpath);
/*
* Calculate the maximum rpath length (will be equal to rpathlen unless
* we have previously truncated it).
*/
for ( i = rpathoff + rpathlen ; i < shdr.sh_size && strtab[i] == '\0' ; i++ );
i--;
if (i> rpathoff + rpathlen)
rpathlen = i - rpathoff;
if (strlen(argv[2]) > rpathlen)
{
fprintf(stderr, "new rpath '%s' too large; maximum length %i\n",
argv[2], rpathlen);
return 7;
}
memset(rpath, 0, rpathlen);
strcpy(rpath, argv[2]);
if (lseek(fd, shdr.sh_offset+rpathoff, SEEK_SET) == -1)
{
perror ("positioning for RPATH");
return 1;
}
if (write(fd, rpath, rpathlen) != rpathlen)
{
perror ("writing RPATH");
return 1;
}
printf("%s:new RPATH: %s\n", argv[1], rpath);
return 0;
}
------------------------------
From: [EMAIL PROTECTED]
Date: Fri, 30 Apr 1999 18:16:03 ric
Subject: Re: RedHat upgrade
On Fri, 30 Apr 1999, Ivan Eyara wrote:
> Hello everybody,
>
> I upgraded my RedHat from version 5.0 to version 5.2 some days ago.
> Everything seemed to be going fine but yesteday I found the problem.
>
> I can't compile, link and run a application written in C that worked
> correctly in the previous version. This is the log:
>
> 1) First time I tried to compile and link it after a few changes in its
> code I got the link error: undefined reference to the function fmod().
> This functions is called from a module I had not changed for months.
>
> 2) I changed the Makefile and compiled the application with -lm in
order
> to link libm library and the compilation/link was ok.
>
> 3) When I run this version I got a segmentation fault that I had never
> got.
>
> 4) I thought that the problem could be in the new changes and after a
> long time looking for the problem I decided to restore a previous
> backup. This backups contains the original code and the orirginal
> Makefile.
>
> 5) I tried to compile and link again and I got the same link error:
> undefined reference to the function fmod().
^^^^ Try this with -lm or:
>
> 6) I decided to compile and link this version in a RedHat 5.0 box and
> the result is ok.
>
Try compileing your new version on a RedHat 5.0 box.
You haven't shown us a case of the same source that works on 5.0 and
fails on 5.2 yet. :-). If it needs math.h in the source, it _should_
need -lm in the Makefile. This sounds like a bug in 5.0 that was fixed
in 5.2.
Lawson
>< Microsoft free environment
This mail client runs on Wine. Your mileage may vary.
___________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com/getjuno.html
or call Juno at (800) 654-JUNO [654-5866]
------------------------------
From: Linas Vepstas <[EMAIL PROTECTED]>
Date: Sun, 2 May 1999 20:24:54 -0500
Subject: when are new versions released?
Hi,
I haven't heard a peep about new versions of egcs or glibc
in many months. A month ago, I dropped a patch for s/390
egcs-1.1.2 and it echoed like a bottomless pit. I have
a new improved patch ready ... I am concerned ... are the
maintainers overworked?
I also have a patch ready against glibc-2.1 for s/390. Who
wants that? Where do I send it to make it official?
==========
I'm asking these questions because by contrast H.J. Lu does
a marvelous job maintaining binutils; when I send a patch,
I know its received & I see a new rev of binutils a few
days/weeks later. It gives me the warm fuzzies that its
getting out there.
- --linas
------------------------------
From: [EMAIL PROTECTED]
Date: Mon, 19 Apr 99 00:45:01 Pacific Daylight Time
Subject: adv: Important Psychic Message For You...
LIVE PERSONAL PSYCHIC! (as seen on T.V.)
LEARN TODAY WHAT YOUR FUTURE HOLDS FOR
LOVE, MONEY, MARRIAGE, JOB, & HEALTH
ASTROLOGY CLAIRVOYANCY
NUMEROLOGY TAROT
ALL QUESTIONS ANSWERED IMMEDIATELY!
REALIZE YOUR DESTINY! CALL RIGHT NOW!
1-900-226-4140 or 1-800-372-3384 for VISA, MC, & AMEX
(These are not sex lines!)
This message is intended for Psychic Readers, Psychic Users and people who are
involved in the $1 Billion a year Psychic Industry. If this message has reached you in
error, please disregard it and accept our apoligies. To be removed from this list,
please respond with the subject "remove". Thank You.
LIVE PERSONAL PSYCHIC! (as seen on T.V.)
LEARN TODAY WHAT YOUR FUTURE HOLDS FOR
OVE, MONEY, MARRIAGE, JOB, & HEALTH
------------------------------
From: Ulrich Drepper <[EMAIL PROTECTED]>
Date: 03 May 1999 13:47:03 -0700
Subject: glibc 2.1.1pre2
Hi,
I've uploaded to
ftp://sourceware.cygnus.com/pub/glibc
and
ftp://alpha.gnu.org/gnu
and
ftp://ftp.XX.kernel.org/pub/software/libs/glibc
(where XX is your country code) the latest test release of glibc
2.1.1. It'll hopefully be the last for 2.1.1. The files to download
are
glibc-2.1.1pre1-2.1.1pre2.diff.gz
(or glibc-2.1.1pre2.tar.gz if you need the whole tarball)
and
glibc-linuxthreads-2.1.1pre2.tar.gz
The crypt add-on hasn't changed, use the 2.1 version.
New in this release:
- - lots of bug fixes
Beside general one also several specific to Arm.
- - SPARC optimizations by Jakub Jelinek
- - more Hurd changes (Roland, Mark)
- - fix of a few compatibility problems
- - several locale data extensions
- - updates for charmaps according to current Unicode converison tables
(a lot Euro stuff)
- - many performance improvements (mainly by me); startup times of applications
should be reduced measurably
Give it a try. I'm quite comfortable with this version and if no
problems are reported it'll go out as 2.1.1.
- --
- ---------------. drepper at gnu.org ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com `------------------------
------------------------------
From: [EMAIL PROTECTED]
Date: Mon, 03 May 1999 13:49:38 ric
Subject: Re: RedHat upgrade
On Mon, 3 May 1999, Ivan Eyara wrote:
I guess I have been barrking up the wrong tree, then. :-) I don't
understand how RH 5.0 is able to resolve fmod() without -lm.
The includes are really _part_ of the library, but that doesn't help
much with a bundled set like glibc. I'm sorry, I don't know where to
look for doco on that.
Lawson
>
>
> Hello again,
>
> After sendind the original message I mounted my src directory on a
> RedHat5.0 box, remade the changes and compiled them. The application is
> running since then. I didn't use -lm in te makefile. By the way: if I
> link the libm I get segmentation fault in the RedHat5.0.
>
> On the other hand: where could I find information about what libraries
> are needed by the includes?
>
> Thank you,
> --
> Ivan Eyara [EMAIL PROTECTED]
> Software development
> ZUNIBAL,S.L. http://www.zunibal.com
>
___________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com/getjuno.html
or call Juno at (800) 654-JUNO [654-5866]
------------------------------
From: Adam Wiggins <[EMAIL PROTECTED]>
Date: Mon, 3 May 1999 17:44:05 -0700 (PDT)
Subject: gnu c large int's (fwd)
A college of mine is working with egcs. I realize this isn't strictly
Linux-oriented, but it raised my curiosity - how does one deal with >64
bit ints with egcs/gcc?
- ---------- Forwarded message ----------
Subject: gnu c large int's
I'm trying to get some code working under Windows using Cygnus's g++, using
128-bit ints, using
typef long int128 __attribute__ ((mode(TI)));
First off, I'm getting link error'ss when I try to basic arithmetic on
them -
multiplacation needs __multi3
shift right needs __ashrti3
and so on (addition seems ok). I can't find these functions in any of the
supplied libraries... or are these unimplemented RTF functions ?
Also, if I can get this working, any ideas on how to printf a large int ?
Variable arguments are a pain in the arse, coz normally everythings
converted to 'long' on the stack... but obviously the high order bits will
drop off in the conversion of an int128...
Thanks for any help....
------------------------------
End of linux-gcc-digest V1 #392
*******************************
To subscribe to linux-gcc-digest, send the command:
subscribe linux-gcc-digest
in the body of a message to "[EMAIL PROTECTED]". If you want
to subscribe something other than the account the mail is coming from,
such as a local redistribution list, then append that address to the
"subscribe" command; for example, to subscribe "local-linux-gcc":
subscribe linux-gcc-digest [EMAIL PROTECTED]
A non-digest (direct mail) version of this list is also available; to
subscribe to that instead, replace all instances of "linux-gcc-digest"
in the commands above with "linux-gcc".