| 1 | This is the GNU linker. It is distributed with other "binary |
| 2 | utilities" which should be in ../binutils. See ../binutils/README for |
| 3 | more general notes, including where to send bug reports. |
| 4 | |
| 5 | There are many features of the linker: |
| 6 | |
| 7 | * The linker uses a Binary File Descriptor library (../bfd) |
| 8 | that it uses to read and write object files. This helps |
| 9 | insulate the linker itself from the format of object files. |
| 10 | |
| 11 | * The linker supports a number of different object file |
| 12 | formats. It can even handle multiple formats at once: |
| 13 | Read two input formats and write a third. |
| 14 | |
| 15 | * The linker can be configured for cross-linking. |
| 16 | |
| 17 | * The linker supports a control language. |
| 18 | |
| 19 | * There is a user manual (ld.texinfo), as well as the |
| 20 | beginnings of an internals manual (ldint.texinfo). |
| 21 | |
| 22 | Installation |
| 23 | ============ |
| 24 | |
| 25 | See ../binutils/README. |
| 26 | |
| 27 | If you want to make a cross-linker, you may want to specify |
| 28 | a different search path of -lfoo libraries than the default. |
| 29 | You can do this by setting the LIB_PATH variable in ./Makefile. |
| 30 | |
| 31 | To build just the linker, make the target all-ld from the top level |
| 32 | directory (one directory above this one). |
| 33 | |
| 34 | Porting to a new target |
| 35 | ======================= |
| 36 | |
| 37 | See the ldint.texinfo manual. |
| 38 | |
| 39 | Reporting bugs etc |
| 40 | =========================== |
| 41 | |
| 42 | See ../binutils/README. |
| 43 | |
| 44 | Known problems |
| 45 | ============== |
| 46 | |
| 47 | The Solaris linker normally exports all dynamic symbols from an |
| 48 | executable. The GNU linker does not do this by default. This is |
| 49 | because the GNU linker tries to present the same interface for all |
| 50 | similar targets (in this case, all native ELF targets). This does not |
| 51 | matter for normal programs, but it can make a difference for programs |
| 52 | which try to dlopen an executable, such as PERL or Tcl. You can make |
| 53 | the GNU linker export all dynamic symbols with the -E or |
| 54 | --export-dynamic command line option. |
| 55 | |
| 56 | HP/UX 9.01 has a shell bug that causes the linker scripts to be |
| 57 | generated incorrectly. The symptom of this appears to be "fatal error |
| 58 | - scanner input buffer overflow" error messages. There are various |
| 59 | workarounds to this: |
| 60 | * Build and install bash, and build with "make SHELL=bash". |
| 61 | * Update to a version of HP/UX with a working shell (e.g., 9.05). |
| 62 | * Replace "(. ${srcdir}/scripttempl/${SCRIPT_NAME}.sc)" in |
| 63 | genscripts.sh with "sh ${srcdir}..." (no parens) and make sure the |
| 64 | emulparams script used exports any shell variables it sets. |