Skip to content

Commit

Permalink
Update.
Browse files Browse the repository at this point in the history
2003-05-28  Ulrich Drepper  <[email protected]>

	* include/libc-symbols.h: Define hidden attribute for real also if
	LIBC_NONSHARED is defined.  Patch by Jakub Jelinek.

	* csu/Makefile: Add rules to build Scrt1.o.
	* sysdeps/i386/elf/start.S: Make code compilable with SHARED.
  • Loading branch information
Ulrich Drepper committed May 28, 2003
1 parent 40a54e4 commit bc4647a
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 6 deletions.
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2003-05-28 Ulrich Drepper <[email protected]>

* include/libc-symbols.h: Define hidden attribute for real also if
LIBC_NONSHARED is defined. Patch by Jakub Jelinek.

* csu/Makefile: Add rules to build Scrt1.o.
* sysdeps/i386/elf/start.S: Make code compilable with SHARED.

2003-05-27 Jakub Jelinek <[email protected]>

* stdio-common/vfprintf.c (process_arg, process_string_arg): Use
Expand Down
19 changes: 16 additions & 3 deletions csu/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ routines = init-first libc-start $(libc-init) sysdep version check_fds \
aux = errno
elide-routines.os = libc-tls
static-only-routines = elf-init
csu-dummies = $(filter-out $(start-installed-name),crt1.o Mcrt1.o)
csu-dummies = $(filter-out $(start-installed-name),crt1.o Scrt1.o Mcrt1.o)
extra-objs = start.o gmon-start.o \
$(start-installed-name) g$(start-installed-name) $(csu-dummies)
omit-deps = $(patsubst %.o,%,$(start-installed-name) g$(start-installed-name) \
b$(start-installed-name) $(csu-dummies))
b$(start-installed-name) $(csu-dummies) \
S$(start-installed-name))
install-lib = $(start-installed-name) g$(start-installed-name) $(csu-dummies)
distribute = initfini.c gmon-start.c start.c defs.awk munch.awk \
abi-note.S init.c munch-tmpl.c not-cancel.h
Expand All @@ -49,6 +50,11 @@ all: # Make this the default target; it will be defined in Rules.

include ../Makeconfig

ifeq (yes,$(build-shared))
extra-objs += S$(start-installed-name)
install-lib += S$(start-installed-name)
endif

ifeq (yes,$(build-bounded))
extra-objs += b$(start-installed-name)
install-lib += b$(start-installed-name)
Expand Down Expand Up @@ -149,6 +155,9 @@ ifeq (yes,$(elf))
$(objpfx)$(start-installed-name): $(objpfx)start.o $(objpfx)abi-note.o \
$(objpfx)init.o
$(link-relocatable)
$(objpfx)S$(start-installed-name): $(objpfx)start.os $(objpfx)abi-note.o \
$(objpfx)init.o
$(link-relocatable)
$(objpfx)b$(start-installed-name): $(objpfx)start.ob $(objpfx)abi-note.ob \
$(objpfx)init.ob
$(link-relocatable)
Expand All @@ -158,6 +167,9 @@ else
$(objpfx)$(start-installed-name): $(objpfx)start.o
rm -f $@
ln $< $@
$(objpfx)S$(start-installed-name): $(objpfx)start.os
rm -f $@
ln $< $@
$(objpfx)b$(start-installed-name): $(objpfx)start.ob
rm -f $@
ln $< $@
Expand All @@ -174,7 +186,8 @@ $(addprefix $(objpfx),$(sort g$(start-installed-name) \

# These extra files are sometimes expected by system standard linking
# procedures, but we have nothing for them to do. So compile empty files.
$(addprefix $(objpfx),$(filter-out $(start-installed-name),$(csu-dummies))):\
$(addprefix $(objpfx),$(filter-out $(start-installed-name)\
S$(start-installed-name),$(csu-dummies))):\
$(before-compile)
$(COMPILE.c) -o $@ -x c /dev/null

Expand Down
3 changes: 2 additions & 1 deletion include/libc-symbols.h
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,8 @@
strong_alias(real, name)
#endif

#if defined HAVE_VISIBILITY_ATTRIBUTE && defined SHARED
#if defined HAVE_VISIBILITY_ATTRIBUTE \
&& (defined SHARED || defined LIBC_NONSHARED)
# define attribute_hidden __attribute__ ((visibility ("hidden")))
#else
# define attribute_hidden
Expand Down
2 changes: 1 addition & 1 deletion nptl/Banner
Original file line number Diff line number Diff line change
@@ -1 +1 @@
NPTL 0.40 by Ulrich Drepper
NPTL 0.41 by Ulrich Drepper
29 changes: 28 additions & 1 deletion sysdeps/i386/elf/start.S
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Startup code compliant to the ELF i386 ABI.
Copyright (C) 1995,1996,1997,1998,2000,2001, 2002 Free Software Foundation, Inc.
Copyright (C) 1995-1998,2000,2001,2002,2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -67,6 +67,27 @@ _start:
pushl %edx /* Push address of the shared library
termination function. */

#ifdef SHARED
/* Load PIC register. */
call 1f
addl $_GLOBAL_OFFSET_TABLE_, %ebx

/* Push address of our own entry points to .fini and .init. */
leal __libc_csu_fini@GOTOFF(%ebx), %eax
pushl %eax
leal __libc_csu_init@GOTOFF(%ebx), %eax
pushl %eax

pushl %ecx /* Push second argument: argv. */
pushl %esi /* Push first argument: argc. */

leal BP_SYM (main)@GOTOFF(%ebx), %eax
pushl %eax

/* Call the user's main function, and exit with its value.
But let the libc call main. */
call BP_SYM (__libc_start_main)@PLT
#else
/* Push address of our own entry points to .fini and .init. */
pushl $__libc_csu_fini
pushl $__libc_csu_init
Expand All @@ -79,9 +100,15 @@ _start:
/* Call the user's main function, and exit with its value.
But let the libc call main. */
call BP_SYM (__libc_start_main)
#endif

hlt /* Crash if somehow `exit' does return. */

#ifdef SHARED
1: movl (%esp), %ebx
ret
#endif

/* To fulfill the System V/i386 ABI we need this symbol. Yuck, it's so
meaningless since we don't support machines < 80386. */
.section .rodata
Expand Down

0 comments on commit bc4647a

Please sign in to comment.