Commit Graph

424 Commits

Author SHA1 Message Date
mrg
e487cf62f5 add a .globl to MD_SECTION_PROLOGUE so that the symbol is exported.
this fixes build problems with GCC4 (which will use smaller/faster call
methods for local/static functions) and is the right thing anyway.
2006-06-12 22:05:49 +00:00
mrg
db19e89e04 remove support for building (with) GCC 2.95. also:
- always install <stdbool.h>
- don't generate a fake one for vax / gettext.
2006-06-02 22:16:18 +00:00
christos
351fa65664 Instead of using -I- -I${.CURDIR} and #include "dot_init.h", use:
-I${.CURDIR} and #include <dot_init.h>, since -I- is obsoleted in gcc-4,
and it is too confusing anyway.
2006-05-19 19:11:12 +00:00
christos
96473fa808 change __weak_extern to __weak_reference so that gcc4 works. 2006-05-18 17:54:19 +00:00
christos
065d43d6c4 Revert previous changes which are unnecessary now the _DYNAMIC is marked
weak.
2006-05-17 17:08:54 +00:00
christos
e08e654f06 Mark _DYNAMIC to have attribute __weakref__, so that gcc-4 does not optimize
&_DYNAMIC == NULL away. From Matt Thomas.
2006-05-17 17:08:07 +00:00
christos
f32828209d Back out accidental commit that changed -I- 2006-05-17 17:02:16 +00:00
christos
6f1784f6d3 Fool gcc to compare against a null variable instead of the NULL constant
so that it does not optimize the &_DYNAMIC == NULL away. Idea from Matt.
2006-05-17 17:01:12 +00:00
christos
94b00d6e09 Avoid weak symbol related bug with _DYNAMIC not being referenced in the
code at all for gcc-4. Fixes statically linked binaries, but the fix is
bogus.
2006-05-17 16:39:25 +00:00
mrg
169832563d with GCC4 we *need* to pass -fno-unit-at-a-time otherwise GCC
reorders things breaking _init() and _fini().

for i386, the {init,fini}_fallthru() functions were being output
_before_ the _init()/ _fini(), and instead of falling through to
the rest of the .init/.fini section, it would fall through to
_init()/_fini() again, and again, and again, until the stack was
exhausted.

now i386 works, but i have not checked that this works for
sparc64 as well.
2006-05-13 01:40:34 +00:00
perry
2d65de2479 bare asm -> __asm 2005-12-24 22:45:33 +00:00
perry
0db47b5ca1 bare asm -> __asm 2005-12-24 21:51:51 +00:00
perry
8b7a2f14e9 __asm__ -> __asm 2005-12-24 21:38:40 +00:00
perry
4e11af46bc Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 21:11:15 +00:00
skrll
b7ddf5b9cb Copyright Maintenance 2005-05-21 06:46:34 +00:00
thorpej
70638a64cb Error out if we try to build with GCC 3.3 or later; we should be using
the GCC-supplied crtbegin / crtend in the GCC 3.3 or later case.
2004-08-28 00:19:22 +00:00
thorpej
8d13a4aafe Switch to using GCC's supplied crtbegin / crtend files. 2004-08-28 00:18:38 +00:00
thorpej
08456b0802 Use ANSI function decls. 2004-08-26 21:23:06 +00:00
thorpej
5c50ce218e Remove the "allows linking without crtbegin / crtend" hack. 2004-08-26 21:21:33 +00:00
thorpej
b979dc154e Use ANSI function decls. 2004-08-26 21:21:05 +00:00
thorpej
54fe33a634 Use ANSI function decls. 2004-08-26 21:09:52 +00:00
thorpej
a41fd2dbc8 - Use ANSI function decls.
- Use __used__, not __unused__ attribute for ___start().
2004-08-26 21:07:14 +00:00
thorpej
68e26dcdb6 _strrchr()'s second argument is actually an int. 2004-08-26 21:01:12 +00:00
thorpej
352bb3a6aa Use ANSI function decls. 2004-08-26 20:57:47 +00:00
thorpej
11b5ec27b8 Remove sysident.h-related comment; that stuff is handled by crti.c these
days.
2004-08-26 20:51:27 +00:00
rearnsha
29efdff284 Temporary hack to work around ld problems when linking Thumb
applications where the linker does not correctly insert an
interworking veneer.
2004-08-21 12:12:28 +00:00
chs
ddc1ca7bcb map the data segment with PROT_EXEC since the PLT lives there. 2004-08-07 21:33:04 +00:00
skrll
5e2026a163 Add code code for .init and .fini section fallthroughs and regression
test.
2004-05-18 19:19:34 +00:00
skrll
c007da99a0 Update for ELF. 2004-05-17 10:44:22 +00:00
skrll
f01797a30f Fix typos so that we define _start and __start.
The linker script gets the right entry point now.
2004-04-30 08:11:37 +00:00
skrll
337520b409 Include bsd.own.mk before testing MKPIC 2004-03-09 20:04:00 +00:00
simonb
216a472c99 Use -fPIC only if MKPIC isn't "no". 2004-02-14 08:41:58 +00:00
simonb
fb8a44d89d Don't build lcrt.o (version of crt0.o that looks in /libexec/ for the
shared linker) if we have MKPIC=no.
2004-02-14 07:48:37 +00:00
matt
69f9c8b092 Add MD_CALL_STATIC_FUNCTION. This allows crt* to compiled with -g. 2003-12-22 21:05:01 +00:00
christos
480316c216 Make sure this still compiles with gcc-2.95. Hello vaxen! 2003-12-03 18:41:35 +00:00
lukem
3921361c6a Use __attribute__((__used__,__noinline__)) (instead of __unused__)
for __do_global_ctors_aux() and __do_global_dtors_aux(),
to fix building with gcc3 -O3.
Discussed with Matt Thomas & Christos Zoulas, and tested on alpha & i386.
2003-12-02 03:01:19 +00:00
fvdl
e367e360a4 The x86_64 assembler seems to get it wrong when assembling
_eprol@GOTPCREL, it resolved it internally as a PC-relative instruction,
getting garbage, since the needed value is in the GOT. Add a CPP hook
to export it explicitly, this makes it work. Only active on amd64. XXX
2003-11-28 23:25:54 +00:00
dsl
8acea4b2c0 Make {g|s|l}crt0.o depend on crt.o and remove the non-standand .afterdepend
translation.
2003-11-11 11:35:03 +00:00
dsl
016359fc65 Make gcrt0.o depend on crt0.o so that it picks up the dependencies from .depend. 2003-11-11 11:32:39 +00:00
agc
b2b49933f4 Move Matt Green's code from a 4-clause to a 3-clause licence by removing
the advertising clause. Diffs provided in PR 22396 by Joel Baker, the changes
were confirmed to the board by Matt Green.
2003-10-13 14:22:20 +00:00
matt
3e272c0b2a Deal with the new toolchain. 2003-10-06 05:28:05 +00:00
fvdl
7e7bcf4bc9 Allow platforms to define __EH_FRAME_CONST. Currently "const" for x86_64,
empty for others. x86_64 (and s390, which we do not have) have .eh_frame
as a read-only section, so __EH_FRAME_BEGIN__ and the register/deregister
functions must take a const foo *.

This also fixes an ICE in gcc 3.3.1 (see gcc PR #9552)
2003-09-07 22:27:54 +00:00
skrll
d900731978 Resolve dlsym(3) and friends directly so that dlsym(RTLD_NEXT,...) works.
Previously dlsym resolved to the version in crt0.o or libc which would
mean that the caller's shared object couldn't be determined correctly
using __builtin_return_address(0).

Mainly from FreeBSD, but adapted by me. Benefits of this solutions are:

	- backward comptibility maintained
	- existing broken binaries are fixed with a new ld.elf_so
	- __mainprog_obj can be removed from crt0.o
	- we do the same thing as FreeBSD

Fixes PR 22067.

OKed by Jason and Christos.
2003-08-12 09:18:38 +00:00
salo
99410184e7 netbsd.org->NetBSD.org 2003-07-26 19:24:24 +00:00
uwe
fa9c69303e Fix previous. s/_start/___start/ in the declaration as well. 2003-07-05 23:50:28 +00:00
marcus
bcd3ee1e02 Provide entry point as both _start and __start, like i386 port does. 2003-07-05 22:51:12 +00:00
thorpej
c2048dc2a3 Don't need sysident.h here anymore; crti provides it. 2003-05-31 19:41:24 +00:00
scw
aa018ec72e Add a work-around for an SH5 binutils bug which results in bogus
GOT offsets in the PIC-compiled crt0 of statically linked binaries.
2003-04-01 10:20:38 +00:00
scw
89380eb358 Add PIC support. 2003-03-24 14:32:57 +00:00
ross
88929ccff1 crt{begin,end}S.o must now depend on the new crt{begin,end}S.c wrappers 2003-03-19 16:54:25 +00:00