Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update.
2001-09-07  Tom Rix  <trix@redhat.com>

	* sysdeps/unix/sysv/aix/sysv_termio.h: New file.

2001-08-26  Tom Rix  <trix@redhat.com>

	* sysdeps/unix/sysv/aix/Makefile (aix-syscalls.o): More linker
	command line options.
	* sysdeps/unix/sysv/aix/start.s: New file, rework of start.c
	* sysdeps/unix/sysv/aix/start.c: Removed.
	* sysdeps/unix/sysv/aix/start-libc.c: New file.
	* sysdeps/unix/sysv/aix/init-first.c: New file.
	* sysdeps/unix/sysv/aix/fcntl.c: Alias __libc_fcntl to __fcntl.

2001-09-08  Ben Collins  <bcollins@debian.org>

	* sysdeps/arm/dl-machine.h: Fix usage of new _dl_signal_error() format.
	* sysdeps/generic/dl-machine.h: Likewise.
	* sysdeps/hppa/dl-fptr.c: Likewise.
	* sysdeps/ia64/dl-fptr.c: Likewise.
	* sysdeps/mach/hurd/dl-sysdep.c: Likewise.
	* sysdeps/mips/dl-machine.h: Likewise.
	* sysdeps/mips/mips64/dl-machine.h: Likewise.
	* sysdeps/powerpc/dl-machine.c: Likewise.

2001-09-07  Ben Collins  <bcollins@debian.org>

	* sysdeps/sparc/sparc32/dl-machine.h: Fix typo.

	* sysdeps/hppa/dl-lookupcfg.h: Forward declare struct link_map.

	* elf/dl-lookup.c (add_dependency): Bump l_opencount of all
	dependencies if necessary.
  • Loading branch information
Ulrich Drepper committed Sep 8, 2001
1 parent c4bb124 commit 84aafa9
Show file tree
Hide file tree
Showing 20 changed files with 706 additions and 314 deletions.
34 changes: 34 additions & 0 deletions ChangeLog
@@ -1,5 +1,39 @@
2001-09-07 Tom Rix <trix@redhat.com>

* sysdeps/unix/sysv/aix/sysv_termio.h: New file.

2001-08-26 Tom Rix <trix@redhat.com>

* sysdeps/unix/sysv/aix/Makefile (aix-syscalls.o): More linker
command line options.
* sysdeps/unix/sysv/aix/start.s: New file, rework of start.c
* sysdeps/unix/sysv/aix/start.c: Removed.
* sysdeps/unix/sysv/aix/start-libc.c: New file.
* sysdeps/unix/sysv/aix/init-first.c: New file.
* sysdeps/unix/sysv/aix/fcntl.c: Alias __libc_fcntl to __fcntl.

2001-09-08 Ben Collins <bcollins@debian.org>

* sysdeps/arm/dl-machine.h: Fix usage of new _dl_signal_error() format.
* sysdeps/generic/dl-machine.h: Likewise.
* sysdeps/hppa/dl-fptr.c: Likewise.
* sysdeps/ia64/dl-fptr.c: Likewise.
* sysdeps/mach/hurd/dl-sysdep.c: Likewise.
* sysdeps/mips/dl-machine.h: Likewise.
* sysdeps/mips/mips64/dl-machine.h: Likewise.
* sysdeps/powerpc/dl-machine.c: Likewise.

2001-09-07 Ben Collins <bcollins@debian.org>

* sysdeps/sparc/sparc32/dl-machine.h: Fix typo.

* sysdeps/hppa/dl-lookupcfg.h: Forward declare struct link_map.

2001-09-08 Ulrich Drepper <drepper@redhat.com>

* elf/dl-lookup.c (add_dependency): Bump l_opencount of all
dependencies if necessary.

* elf/dl-close.c (_dl_close): If object has no r_list (i.e., wasn't
loaded directly) determine length if l_initfini list by iterating
over its elements. Minor optimizations.
Expand Down
11 changes: 9 additions & 2 deletions elf/dl-lookup.c
Expand Up @@ -151,8 +151,15 @@ add_dependency (struct link_map *undef_map, struct link_map *map)
if (__builtin_expect (act < undef_map->l_reldepsmax, 1))
undef_map->l_reldeps[undef_map->l_reldepsact++] = map;

/* And increment the counter in the referenced object. */
++map->l_opencount;
if (map->l_searchlist.r_list != NULL)
/* And increment the counter in the referenced object. */
++map->l_opencount;
else
/* We have to bump the counts for all dependencies since so far
this object was only a normal or transitive dependency.
Now it might be closed with _dl_close() directly. */
for (list = map->l_initfini; *list != NULL; ++list)
++(*list)->l_opencount;

/* Display information if we are debugging. */
if (__builtin_expect (_dl_debug_mask & DL_DEBUG_FILES, 0))
Expand Down
4 changes: 2 additions & 2 deletions elf/reldep2.c
Expand Up @@ -53,8 +53,8 @@ main (void)
exit (1);
}

/* Now close the first object. If must still be around since we have
a implicit dependency. */
/* Now close the first object. It must still be around since we have
an implicit dependency. */
if (dlclose (h1) != 0)
{
printf ("closing h1 failed: %s\n", dlerror ());
Expand Down
2 changes: 1 addition & 1 deletion sysdeps/arm/dl-machine.h
Expand Up @@ -501,7 +501,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
topbits = newvalue & 0xfe000000;
if (topbits != 0xfe000000 && topbits != 0x00000000)
{
_dl_signal_error (0, map->l_name,
_dl_signal_error (0, map->l_name, NULL,
"R_ARM_PC24 relocation out of range");
}
}
Expand Down
2 changes: 1 addition & 1 deletion sysdeps/generic/dl-machine.h
Expand Up @@ -95,7 +95,7 @@ elf_machine_rela (Elf32_Addr loadaddr, Elf32_Dyn *info[DT_NUM],
int noplt))
{
_dl_signal_error (0, "Elf32_Rela relocation requested -- unused on "
ELF_MACHINE_NAME);
NULL, ELF_MACHINE_NAME);
}


Expand Down
4 changes: 2 additions & 2 deletions sysdeps/hppa/dl-fptr.c
Expand Up @@ -101,7 +101,7 @@ __hppa_make_fptr (const struct link_map *sym_map, Elf32_Addr value,
if (_dl_zerofd == -1)
{
__close (fd);
_dl_signal_error (errno, NULL,
_dl_signal_error (errno, NULL, NULL,
"cannot open zero fill device");
}
}
Expand All @@ -110,7 +110,7 @@ __hppa_make_fptr (const struct link_map *sym_map, Elf32_Addr value,
__fptr_next = __mmap (0, _dl_pagesize, PROT_READ | PROT_WRITE,
MAP_ANON | MAP_PRIVATE, ANONFD, 0);
if (__fptr_next == MAP_FAILED)
_dl_signal_error(errno, NULL, "cannot map page for fptr");
_dl_signal_error(errno, NULL, NULL, "cannot map page for fptr");
__fptr_count = _dl_pagesize / sizeof (struct hppa_fptr);
}
f = __fptr_next++;
Expand Down
3 changes: 3 additions & 0 deletions sysdeps/hppa/dl-lookupcfg.h
Expand Up @@ -23,6 +23,9 @@
#define ELF_FUNCTION_PTR_IS_SPECIAL
#define DL_UNMAP_IS_SPECIAL

/* Forward declaration. */
struct link_map;

void *_dl_symbol_address (const struct link_map *map, const ElfW(Sym) *ref);

#define DL_SYMBOL_ADDRESS(map, ref) _dl_symbol_address(map, ref)
Expand Down
6 changes: 3 additions & 3 deletions sysdeps/ia64/dl-fptr.c
Expand Up @@ -109,7 +109,7 @@ new_fdesc_table (struct local *l)
new_table = __mmap (0, size, PROT_READ | PROT_WRITE,
MAP_ANON | MAP_PRIVATE, -1, 0);
if (new_table == MAP_FAILED)
_dl_signal_error (errno, NULL, "cannot map pages for fdesc table");
_dl_signal_error (errno, NULL, NULL, "cannot map pages for fdesc table");

new_table->len = (size - sizeof (*new_table)) / sizeof (struct ia64_fdesc);
fdesc = &new_table->fdesc[0];
Expand Down Expand Up @@ -182,7 +182,7 @@ make_fptr_table (struct link_map *map)
fptr_table = __mmap (NULL, size, PROT_READ | PROT_WRITE,
MAP_ANON | MAP_PRIVATE, -1, 0);
if (fptr_table == MAP_FAILED)
_dl_signal_error (errno, NULL, "cannot map pages for fptr table");
_dl_signal_error (errno, NULL, NULL, "cannot map pages for fptr table");

map->l_mach.fptr_table_len = len;
map->l_mach.fptr_table = fptr_table;
Expand All @@ -203,7 +203,7 @@ __ia64_make_fptr (struct link_map *map, const Elf64_Sym *sym, Elf64_Addr ip)
symidx = sym - symtab;

if (symidx >= map->l_mach.fptr_table_len)
_dl_signal_error (0, NULL,
_dl_signal_error (0, NULL, NULL,
"internal error: symidx out of range of fptr table");

if (!ftab[symidx])
Expand Down
2 changes: 1 addition & 1 deletion sysdeps/mach/hurd/dl-sysdep.c
Expand Up @@ -615,7 +615,7 @@ _dl_important_hwcaps (const char *platform, size_t platform_len, size_t *sz,
/* Return an empty array. Hurd has no hardware capabilities. */
result = (struct r_strlenpair *) malloc (sizeof (*result));
if (result == NULL)
_dl_signal_error (ENOMEM, NULL, "cannot create capability list");
_dl_signal_error (ENOMEM, NULL, NULL, "cannot create capability list");

result[0].str = (char *) result; /* Does not really matter. */
result[0].len = 0;
Expand Down
2 changes: 1 addition & 1 deletion sysdeps/mips/dl-machine.h
Expand Up @@ -239,7 +239,7 @@ elf_machine_runtime_link_map (ElfW(Addr) gpreg, ElfW(Addr) stub_pc)
}
}

_dl_signal_error (0, NULL, "cannot find runtime link map");
_dl_signal_error (0, NULL, NULL, "cannot find runtime link map");
return NULL;
}

Expand Down
2 changes: 1 addition & 1 deletion sysdeps/mips/mips64/dl-machine.h
Expand Up @@ -311,7 +311,7 @@ elf_machine_runtime_link_map (ElfW(Addr) gpreg, ElfW(Addr) stub_pc)
}
}

_dl_signal_error (0, NULL, "cannot find runtime link map");
_dl_signal_error (0, NULL, NULL, "cannot find runtime link map");
return NULL;
}

Expand Down
2 changes: 1 addition & 1 deletion sysdeps/powerpc/dl-machine.c
Expand Up @@ -391,7 +391,7 @@ dl_reloc_overflow (struct link_map *map,
t = stpcpy (t, "'");
}
t = stpcpy (t, " out of range");
_dl_signal_error (0, map->l_name, buffer);
_dl_signal_error (0, map->l_name, NULL, buffer);
}

void
Expand Down
2 changes: 1 addition & 1 deletion sysdeps/sparc/sparc32/dl-machine.h
Expand Up @@ -355,7 +355,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
weak_extern (_dl_rtld_map);
#endif

#if !define RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC
#if !defined RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC
if (__builtin_expect (r_type == R_SPARC_RELATIVE, 0))
{
# if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC
Expand Down
5 changes: 2 additions & 3 deletions sysdeps/unix/sysv/aix/Makefile
Expand Up @@ -11,11 +11,11 @@ sysdep_routines += aix-syscalls
$(objpfx)aix-syscalls.o : /lib/syscalls.exp
echo "static int a;" > foo.c
$(CC) -c foo.c
ld -bM:SRE -bnoentry -bI:/lib/syscalls.exp -bE:/lib/syscalls.exp foo.o -o $@
ld -bM:SRE -bpT:0x00000000 -bpD:0x00000000 -bnoentry -bI:/lib/syscalls.exp -bE:/lib/syscalls.exp foo.o -o $@
rm foo.c foo.o


endif
endif

ifeq ($(subdir),misc)
sysdep_routines += dl-error dl-support dl-libc dl-open dl-sym \
Expand All @@ -39,4 +39,3 @@ inhibit-glue = yes
ifeq ($(subdir),timezone)
CPPFLAGS-zic.c = -Dunix
endif

3 changes: 2 additions & 1 deletion sysdeps/unix/sysv/aix/fcntl.c
@@ -1,4 +1,4 @@
/* Copyright (C) 1999, 2000 Free Software Foundation, Inc.
/* Copyright (C) 1999, 2000, 2001 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 @@ -38,3 +38,4 @@ __fcntl (int fdes, int cmd, ...)
return res;
}
strong_alias (__fcntl, fcntl)
strong_alias (__fcntl, __libc_fcntl)
107 changes: 107 additions & 0 deletions sysdeps/unix/sysv/aix/init-first.c
@@ -0,0 +1,107 @@
/* Initialization code run first thing by the XCOFF startup code. AIX version.
Copyright (C) 2001 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
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */

#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <sysdep.h>
#include <fpu_control.h>
#include <sys/param.h>
#include <sys/types.h>
#include <libc-internal.h>

#ifndef SHARED
# include <ldsodefs.h>
# include "dl-osinfo.h"
#endif

extern void __libc_init (int, char **, char **);

/* The function is called from assembly stubs the compiler can't see. */
static void init (int, char **, char **) __attribute__ ((unused));

extern int _dl_starting_up;
weak_extern (_dl_starting_up)

extern fpu_control_t _dl_fpu_control;
extern int _dl_fpu_control_set;

/* Set nonzero if we have to be prepared for more then one libc being
used in the process. Safe assumption if initializer never runs. */
int __libc_multiple_libcs = 1;

/* Remember the command line argument and enviroment contents for
later calls of initializers for dynamic libraries. */
int __libc_argc;
char **__libc_argv;


static void
init (int argc, char **argv, char **envp)
{
extern void __getopt_clean_environment (char **);
/* The next variable is only here to work around a bug in gcc <= 2.7.2.2.
If the address would be taken inside the expression the optimizer
would try to be too smart and throws it away. Grrr. */

/* XXX disable dl for now
int *dummy_addr = &_dl_starting_up;
__libc_multiple_libcs = dummy_addr && !_dl_starting_up; */

/* Save the command-line arguments. */
__libc_argc = argc;
__libc_argv = argv;
__environ = envp;

#ifndef SHARED
__libc_init_secure ();
#endif

__libc_init (argc, argv, envp);

/* This is a hack to make the special getopt in GNU libc working. */
__getopt_clean_environment (envp);

#ifdef SHARED
__libc_global_ctors ();
#endif
}

#ifdef SHARED

strong_alias (init, _init);

extern void __libc_init_first (void);

void
__libc_init_first (void)
{
}

#else
extern void __libc_init_first (int argc, char **argv, char **envp);

void
__libc_init_first (int argc, char **argv, char **envp)
{
init (argc, argv, envp);
}
#endif

0 comments on commit 84aafa9

Please sign in to comment.