This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Special names tha ld needs to recognize for hppa64-hp-hpux11.X
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: binutils at sources dot redhat dot com
- Date: Tue, 22 Jan 2002 14:06:25 -0500 (EST)
- Subject: Special names tha ld needs to recognize for hppa64-hp-hpux11.X
In looking at the gcc testresults for hppa64-hp-hpux11.00, I noticed that
there is a problem with linking using binutils ld when "-static" was
specified. You get the following error:
Executing on host: /xxx/gnu/gcc-3.1/objdir/gcc/xgcc -B/xxx/gnu/gcc-3.1/objdir/gc
c/ /xxx/gnu/gcc-3.1/gcc/gcc/testsuite/gcc.dg/special/gcsec-1.c -ffunction-secti
ons -fdata-sections -Wl,--gc-sections -static -lm -o ./a.out (timeout = 3
00)
/usr/lib/pa20_64/libc.a(static_vars.o)(.sdata+0x0): undefined reference to `__sy
stab'
Linking the same program with "cc +DA2.0W -Ae -noshared", I find the following
symbols from crt0.o and libc.a appear to have received special treatment:
# /usr/bin/nm a.out|grep ABS
[1164] | 0| 0|NOTYP|GLOB |0| ABS|_FPU_STATUS
[1096] | 0| 0|NOTYP|GLOB |0| ABS|__ARGC
[1097] | 0| 0|NOTYP|GLOB |0| ABS|__ARGV
[852] | 0| 0|NOTYP|GLOB |0| ABS|__CPU_KEYBITS_1
[1161] | 0| 0|NOTYP|GLOB |0| ABS|__CPU_REVISION
[1142] | 0| 0|NOTYP|GLOB |0| ABS|__ENVP
[757] | 0| 0|NOTYP|GLOB |0| ABS|__FPU_MODEL
[1160] | 0| 0|NOTYP|GLOB |0| ABS|__FPU_REVISION
[991] | 0| 0|NOTYP|GLOB |0| ABS|__LOAD_INFO
[804] | 532| 0|NOTYP|GLOB |0| ABS|__SYSTEM_ID
[1080] | 0| 0|NOTYP|GLOB |0| ABS|__SYSTEM_ID_D
[909] | 200| 0|NOTYP|GLOB |0| ABS|__TLS_SIZE
[969] | 0| 0|NOTYP|GLOB |0| ABS|__TLS_SIZE_D
[1008] | 0| 0|NOTYP|GLOB |0| ABS|__libdl_jmp_tbl
[699] | 0| 0|NOTYP|GLOB |0| ABS|__systab
[938] | 9223372041149791520| 0|NOTYP|GLOB |0| ABS|_end
In crt0.o and libc.a, these are "UNDEF GLOBAL OBJECT" or
"DEFINED GLOBAL OBJECT".
The special symbols documented by the linker man page are:
_end: first address beyond the end of the program's address space.
_edata: first address beyond the initialized data.
_etext: first address beyond the program text.
end, edata and etext: defined if referred to in the program.
__TLS_SIZE: total thread local storage size.
_FPU_STATUS: initial status of the FPU status register.
__SYSTEM_ID: largest architecture revision level used by any compilation unit.
A user definition of any of these symbols is treated as an error.
Does anyone have any suggestions on how to best handle the definition
of these special symbols in ld? I am guessing that "_end" and related
symbols must already be handled because that's pretty standard.
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)