1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00
1999-12-07  Scott Bambrough <scottb@netwinder.org>

	* sysdeps/arm/dl-machine.h (elf_machine_rel): Fixup R_ARM_PC24
	relocs if possible.

1999-12-06  Andreas Schwab  <schwab@suse.de>

	* sysdeps/unix/sysv/linux/setrlimit.c: First find out wether the
	ugetrlimit syscall exists.

	* sysdeps/unix/sysv/linux/getrlimit.c: Only put versions on
	exported symbols.
	* sysdeps/unix/sysv/linux/setrlimit.c: Likewise.
This commit is contained in:
Ulrich Drepper
1999-12-08 07:38:14 +00:00
parent 3b187ccb86
commit 841ea81647
4 changed files with 51 additions and 33 deletions

View File

@ -1,3 +1,17 @@
1999-12-07 Scott Bambrough <scottb@netwinder.org>
* sysdeps/arm/dl-machine.h (elf_machine_rel): Fixup R_ARM_PC24
relocs if possible.
1999-12-06 Andreas Schwab <schwab@suse.de>
* sysdeps/unix/sysv/linux/setrlimit.c: First find out wether the
ugetrlimit syscall exists.
* sysdeps/unix/sysv/linux/getrlimit.c: Only put versions on
exported symbols.
* sysdeps/unix/sysv/linux/setrlimit.c: Likewise.
1999-12-07 Ulrich Drepper <drepper@cygnus.com> 1999-12-07 Ulrich Drepper <drepper@cygnus.com>
* iconvdata/ansi_x3.110.c (from_ansi_x3_110): Don't increment * iconvdata/ansi_x3.110.c (from_ansi_x3_110): Don't increment

View File

@ -443,6 +443,23 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
*reloc_addr += value; *reloc_addr += value;
break; break;
} }
case R_ARM_PC24:
{
signed int addend;
addend = *reloc_addr & 0x00ffffff;
if (addend & 0x00800000) addend |= 0xff000000;
value = value - (unsigned int)reloc_addr + (addend << 2);
if (value & 0xfc000003)
_dl_signal_error (0, map->l_name,
"R_ARM_PC24 relocation out of range");
value = value >> 2;
value = (*reloc_addr & 0xff000000) | (value & 0x00ffffff);
*reloc_addr = value;
}
break;
default: default:
_dl_reloc_bad_type (map, ELF32_R_TYPE (reloc->r_info), 0); _dl_reloc_bad_type (map, ELF32_R_TYPE (reloc->r_info), 0);
break; break;

View File

@ -77,11 +77,9 @@ __new_getrlimit (enum __rlimit_resource resource, struct rlimit *rlimits)
#endif #endif
} }
#if defined PIC && DO_VERSIONING
default_symbol_version (__new_getrlimit, __getrlimit, GLIBC_2.1.3);
strong_alias (__new_getrlimit, _new_getrlimit);
default_symbol_version (_new_getrlimit, getrlimit, GLIBC_2.1.3);
#else
weak_alias (__new_getrlimit, __getrlimit); weak_alias (__new_getrlimit, __getrlimit);
#if defined PIC && DO_VERSIONING
default_symbol_version (__new_getrlimit, getrlimit, GLIBC_2.1.3);
#else
weak_alias (__new_getrlimit, getrlimit); weak_alias (__new_getrlimit, getrlimit);
#endif #endif

View File

@ -45,30 +45,21 @@ __new_setrlimit (enum __rlimit_resource resource, const struct rlimit *rlimits)
struct rlimit rlimits_small; struct rlimit rlimits_small;
# ifdef __NR_ugetrlimit # ifdef __NR_ugetrlimit
if (__have_no_new_getrlimit <= 0) if (__have_no_new_getrlimit == 0)
{ {
int result = INLINE_SYSCALL (setrlimit, 2, resource, rlimits); /* Check if the new ugetrlimit syscall exists. We must do this
first because older kernels don't reject negative rlimit
/* Return if the values are not out of range or if we positively values in setrlimit. */
know that the ugetrlimit system call exists. */ result = INLINE_SYSCALL (ugetrlimit, 2, resource, &rlimits_small);
if (result != -1 || errno != EINVAL || __have_no_new_getrlimit < 0) if (result != -1 || errno != ENOSYS)
return result; /* The syscall exists. */
__have_no_new_getrlimit = -1;
/* Check if the new ugetrlimit syscall exists. */ else
if (INLINE_SYSCALL (ugetrlimit, 2, resource, &rlimits_small) != -1 /* The syscall does not exist. */
|| errno != ENOSYS) __have_no_new_getrlimit = 1;
{
/* There was some other error, probably RESOURCE out of range.
Remember that the ugetrlimit system call really exists. */
__have_no_new_getrlimit = -1;
/* Restore previous errno value. */
__set_errno (EINVAL);
return result;
}
/* Remember that the kernel uses the old interface. */
__have_no_new_getrlimit = 1;
} }
if (__have_no_new_getrlimit < 0)
return INLINE_SYSCALL (setrlimit, 2, resource, rlimits);
# endif # endif
/* We might have to correct the limits values. Since the old values /* We might have to correct the limits values. Since the old values
@ -78,16 +69,14 @@ __new_setrlimit (enum __rlimit_resource resource, const struct rlimit *rlimits)
rlimits_small.rlim_max = MIN ((unsigned long int) rlimits->rlim_max, rlimits_small.rlim_max = MIN ((unsigned long int) rlimits->rlim_max,
RLIM_INFINITY >> 1); RLIM_INFINITY >> 1);
/* Try again with the adjusted values. */ /* Use the adjusted values. */
return INLINE_SYSCALL (setrlimit, 2, resource, &rlimits_small); return INLINE_SYSCALL (setrlimit, 2, resource, &rlimits_small);
#endif #endif
} }
#if defined PIC && DO_VERSIONING
default_symbol_version (__new_setrlimit, __setrlimit, GLIBC_2.1.3);
strong_alias (__new_setrlimit, _new_setrlimit);
default_symbol_version (_new_setrlimit, setrlimit, GLIBC_2.1.3);
#else
weak_alias (__new_setrlimit, __setrlimit); weak_alias (__new_setrlimit, __setrlimit);
#if defined PIC && DO_VERSIONING
default_symbol_version (__new_setrlimit, setrlimit, GLIBC_2.1.3);
#else
weak_alias (__new_setrlimit, setrlimit); weak_alias (__new_setrlimit, setrlimit);
#endif #endif