01-18-2011
gcc linker address
Hai,
I have two (Pgm1.c and Pgm2.c) simple programs, which is compiled using gcc. Now we have two exe's (Pgm1 and Pgm2). When i executed the nm Pgm1 and nm Pgm2, in the listed symbols the address of main is same for both programs (08048344 T main) at run time also.
Doubt:
1) What is this address (08048344 T main) ?.
2) If both the address are same how it is loaded into memory?
3) Whether gcc will generate the same address for all programs.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
hai
I have installed Linux 7.0 on my system and i have an doubt the
linker
i ran simple hello.c program with gcc compiler
gcc -c hello.c
i want linker to produce the output
so i put on the command line as
ld first.o -lc
but it is not running ver properly
but there is an... (1 Reply)
Discussion started by: rajashekaran
1 Replies
2. Linux
Hi All,
I m new to this group.
I m facing one problem during my linking of CPP code at Linux env.
after compliation i m getting error
"undefined reference to ....."
Please anyone help me to resolve this error.
Regards,
ASR
make: Leaving directory /fwk'
echo g++ -o server ... (1 Reply)
Discussion started by: ASRRAJ
1 Replies
3. Programming
Im trying to compile some code that involves using X-Windows based functions (XDisplayName() and XOpenDisplay() ), however each time I run the compiler, Im getting a problem with the linker.
The linker says that both XDisplayName() and XOpenDisplay() are unresolved text symbols. Is there a... (1 Reply)
Discussion started by: JamesGoh
1 Replies
4. Solaris
AIM- Install Oracle 11g on Solaris using VMWare
Steps
1.Logged on as root
2.Created subfolders à /usr/local/bin & /usr/local/bin/gcc
3.Downloaded gcc & libiconv & unzipped them on my harddrive & burnt them on CD
4.Copied files from CD to /usr/local/bin/gcc
5.Terminal (root) à pkgadd -d... (8 Replies)
Discussion started by: Ackers
8 Replies
5. Solaris
Hi,
I'm confused about the GCC & Linking process could somebody please briefly explain?
I have GCC 3.4.6 installed from SunFreeware. Reading the narrative alongside the package states "It was compiled to use the SUN assembler and loader usually in /usr/ccs/bin if the SUNW developer packages... (1 Reply)
Discussion started by: Celtic_Monkey
1 Replies
6. HP-UX
Hi,
The necessary symbols in a shared library can be exported to the application using linker option --version-script in Linux. The same can be done in Hp-ux using linker option +e. This can also be done by listing all the global symbols with +e in a file with linker option ld -c filename in... (0 Replies)
Discussion started by: roopa_v
0 Replies
7. Programming
Hi,
I do not use the default linker, and instead us another one and pass this argument -Wl,--dynamic-linker=<path to linker> to gcc when compiling. However, what happens if the linker is not under /lib and /lib64 and I am not able to create a symlink to the linker in /lib or /lib64 due to no... (2 Replies)
Discussion started by: Shompis
2 Replies
8. Programming
I've tried to figure out what the linker is smoking in AIX to no avail...so I'm trying to find a little information to see why it's being inconsistent.
I have the following code in a shared library, it doesn't do anything useful, it's just there to exercise functions in a few system libraries:
... (11 Replies)
Discussion started by: DreamWarrior
11 Replies
9. Solaris
Hey guys
I have a solaris 10 OS, with a zone configured. In that zone, I am trying to install an Oracle Client. However, when I run the oracle installer, I get the following error:
ld.so.1: java: fatal: libexpat.so.0: open failed: No such file or directory
ld.so.1: java: fatal:... (2 Replies)
Discussion started by: goodvikings
2 Replies
10. Programming
I have a build where I wish to link against and load a specific version of a library and a different version of the same library is installed on the system. I'm using a -L option to point to the version that I wish to link against but gcc still seems to choose the installed version. Is there a way... (4 Replies)
Discussion started by: Richard Johnson
4 Replies
FAUCC(1) FAUCC(1)
NAME
faucc - C compiler generating Intel code for 16 bit/32 bit CPUs.
SYNOPSIS
faucc [ -B path ] [ -D MACRO [=def]] [ -E ] [ -I path ] [ -L path ] [ -MD ] [-MF file ] [ -MP ] [ -MT target ] [ -O level ] [ -S ]
[ -T script ] [ -U macro ] [ -Wl,arg ] [ -Xlinker arg ] [ -b arch ] [ -c ] [ -f arg ] [ -m arch ] [ -nostdlib ] [ -o output ]
[ -print-lib-faucc-file-name ] [ --freestanding ] [ --no-stack-protector ] { file ...}
DESCRIPTION
faucc is a C compiler, that can generate Intel 16 bit or 32 bit Code.
OPTIONS
faucc tries to mimic the options of gcc. A number of options will be passed to the C preprocessor cpp or to the linker (done via a call to
the c-compiler gcc) in unmodified form.
-B path
Override the directory prefix where cc1 is looked up with path.
-D MACRO, -D MACRO=def
Define MACRO with the optional initial definition def. If def is omitted, it defaults to 1.
-E
Only perform preprocessing, but do not run the compiler.
-I path
Add path to the include path in which header files are searched.
-L path
Add path to the library search path, in which the linker will look for libraries.
-MD
Output dependency information while preprocessing.
-MF, file
Output dependency information while preprocessing to file.
-MP,
When the preprocessor should output dependency information, it will generate PHONY targets for each dependency.
-MT target
When the preprocessor should output dependency information, use target as the dependency rule target.
-O level
Currently ignored.
-S
Output assembly code.
-T script
Use script as linker script.
-U macro
Undefine a previously defined macro.
-Wl,arg, -Xlinker arg
Pass arg to the linker.
-b arch
Generate code for arch (either i286 or i386)
-c
Perform compilation, but do not link.
-f arg
Pass code generation argument arg to the compiler. See the cc1 man page for possible arguments.
-m arch
Currently ignored.
-nostdlib
With this option, the linker will only search for libraries that are passed as command line arguments.
-o file
Write output to file.
-print-libfaucc-file-name
Print the full path of the internal compiler library libfaucc.a.
-static
Perform static linking.
--freestanding, --no-stack-protector
Currently ignored.
EXAMPLES
faucc -c hello-world.c -o hello-world.o
Compile the program hello-world.c and output the object as hello-wolrd.o.
faucc -S -b i286 -o test.s test.c
Compile the program test.c to 16 bit code and output the assembly listing to test.s, but do not assemble or link the result yet.
SEE ALSO
cc1(1) , cpp(1) , gcc(1) , ld(1)
CONTACT
Please report all bugs to FAUcc Team <info@faumachine.org>. FAUcc Homepage [1].
AUTHOR
FAUcc Team
COPYRIGHT
Copyright (C) 2009 FAUcc Team. Developed at Friedrich Alexander University Erlangen-Nuremberg.
FAUcc comes with ABSOLUTELY NO WARRANTY. FAUcc is free software; you can redistribute it and/or modify it under the terms of the GNU
General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later
version. See COPYING for details.
NOTES
1. FAUcc Homepage
http://www.faumachine.org
FAUcc Team 03/08/2009 FAUCC(1)