* elf/elf.h (ELF64_R_INFO): Cast sym value to Elf64_Xword before
	shifting.
This commit is contained in:
Ulrich Drepper 2000-06-02 00:27:08 +00:00
parent 61d655c1cb
commit 68979757bc
5 changed files with 69 additions and 43 deletions

View File

@ -1,5 +1,8 @@
2000-06-01 Ulrich Drepper <drepper@redhat.com> 2000-06-01 Ulrich Drepper <drepper@redhat.com>
* elf/elf.h (ELF64_R_INFO): Cast sym value to Elf64_Xword before
shifting.
* sysdeps/i386/elf/setjmp.S: Work around change is recent * sysdeps/i386/elf/setjmp.S: Work around change is recent
binutils. gas now emits a jump through the PLT instead of a binutils. gas now emits a jump through the PLT instead of a
relative jump if the jump target is an exported symbol. relative jump if the jump target is an exported symbol.

View File

@ -476,7 +476,7 @@ typedef struct
#define ELF64_R_SYM(i) ((i) >> 32) #define ELF64_R_SYM(i) ((i) >> 32)
#define ELF64_R_TYPE(i) ((i) & 0xffffffff) #define ELF64_R_TYPE(i) ((i) & 0xffffffff)
#define ELF64_R_INFO(sym,type) (((sym) << 32) + (type)) #define ELF64_R_INFO(sym,type) ((((Elf64_Xword) (sym)) << 32) + (type))
/* Program segment header. */ /* Program segment header. */

View File

@ -51,7 +51,7 @@ These @code{typedef}s are in @file{stdint.h}.
If you require that an integer be represented in exactly N bits, use one If you require that an integer be represented in exactly N bits, use one
of the following types, with the obvious mapping to bit size and signedness: of the following types, with the obvious mapping to bit size and signedness:
@itemize @itemize @bullet
@item int8_t @item int8_t
@item int16_t @item int16_t
@item int32_t @item int32_t
@ -68,7 +68,7 @@ size, the corresponding above type does not exist.
If you don't need a specific storage size, but want the smallest data If you don't need a specific storage size, but want the smallest data
structure with @emph{at least} N bits, use one of these: structure with @emph{at least} N bits, use one of these:
@itemize @itemize @bullet
@item int8_least_t @item int8_least_t
@item int16_least_t @item int16_least_t
@item int32_least_t @item int32_least_t
@ -84,7 +84,7 @@ that allows the fastest access while having at least N bits (and
among data structures with the same access speed, the smallest one), use among data structures with the same access speed, the smallest one), use
one of these: one of these:
@itemize @itemize @bullet
@item int8_fast_t @item int8_fast_t
@item int16_fast_t @item int16_fast_t
@item int32_fast_t @item int32_fast_t
@ -100,7 +100,7 @@ which it is being used, use one of the following. If you use these,
you should write code that takes into account the variable size and range you should write code that takes into account the variable size and range
of the integer. of the integer.
@itemize @itemize @bullet
@item intmax_t @item intmax_t
@item uintmax_t @item uintmax_t
@end itemize @end itemize

View File

@ -154,7 +154,7 @@ grows, but doesn't shrink when the stack shrinks.
@node Memory Allocation @node Memory Allocation
@section Allocating Storage For a Program's Data @section Allocating Storage For Program Data
This section covers how ordinary programs manage storage for their data, This section covers how ordinary programs manage storage for their data,
including the famous @code{malloc} function and some fancier facilities including the famous @code{malloc} function and some fancier facilities
@ -280,8 +280,7 @@ any time (or never).
block and clear it. block and clear it.
* Efficiency and Malloc:: Efficiency considerations in use of * Efficiency and Malloc:: Efficiency considerations in use of
these functions. these functions.
* Aligned Memory Blocks:: Allocating specially aligned memory: * Aligned Memory Blocks:: Allocating specially aligned memory.
@code{memalign} and @code{valloc}.
* Malloc Tunable Parameters:: Use @code{mallopt} to adjust allocation * Malloc Tunable Parameters:: Use @code{mallopt} to adjust allocation
parameters. parameters.
* Heap Consistency Checking:: Automatic checking for errors. * Heap Consistency Checking:: Automatic checking for errors.
@ -383,8 +382,8 @@ The block that @code{malloc} gives you is guaranteed to be aligned so
that it can hold any type of data. In the GNU system, the address is that it can hold any type of data. In the GNU system, the address is
always a multiple of eight on most systems, and a multiple of 16 on always a multiple of eight on most systems, and a multiple of 16 on
64-bit systems. Only rarely is any higher boundary (such as a page 64-bit systems. Only rarely is any higher boundary (such as a page
boundary) necessary; for those cases, use @code{memalign} or boundary) necessary; for those cases, use @code{memalign},
@code{valloc} (@pxref{Aligned Memory Blocks}). @code{posix_memalign} or @code{valloc} (@pxref{Aligned Memory Blocks}).
Note that the memory located after the end of the block is likely to be Note that the memory located after the end of the block is likely to be
in use for something else; perhaps a block already allocated by another in use for something else; perhaps a block already allocated by another
@ -617,12 +616,13 @@ after calling @code{free} wastes memory. The size threshold for
The address of a block returned by @code{malloc} or @code{realloc} in The address of a block returned by @code{malloc} or @code{realloc} in
the GNU system is always a multiple of eight (or sixteen on 64-bit the GNU system is always a multiple of eight (or sixteen on 64-bit
systems). If you need a block whose address is a multiple of a higher systems). If you need a block whose address is a multiple of a higher
power of two than that, use @code{memalign} or @code{valloc}. These power of two than that, use @code{memalign}, @code{posix_memalign}, or
functions are declared in @file{stdlib.h}. @code{valloc}. These functions are declared in @file{stdlib.h}.
With the GNU library, you can use @code{free} to free the blocks that With the GNU library, you can use @code{free} to free the blocks that
@code{memalign} and @code{valloc} return. That does not work in BSD, @code{memalign}, @code{posix_memalign}, and @code{valloc} return. That
however---BSD does not provide any way to free such blocks. does not work in BSD, however---BSD does not provide any way to free
such blocks.
@comment malloc.h stdlib.h @comment malloc.h stdlib.h
@comment BSD @comment BSD
@ -634,6 +634,22 @@ somewhat larger block, and then returning an address within the block
that is on the specified boundary. that is on the specified boundary.
@end deftypefun @end deftypefun
@comment stdlib.h
@comment POSIX
@deftypefun int posix_memalign (void **@var{memptr}, size_t @var{alignment}, size_t @var{size})
The @code{posix_memalign} function is similar to the @code{memalign}
function in that it returns a buffer of @var{size} bytes aligned to a
multiple of @var{alignment}. But it adds one requirement to the
parameter @var{alignment}: the value must be a power of two multiple of
@code{sizeof (void *)}.
If the function succeeds in allocation memory a pointer to the allocated
memory is returned in @code{*@var{memptr}} and the return value is zero.
Otherwise the function returns an error value indicating the problem.
This function was introduced in POSIX 1003.1d.
@end deftypefun
@comment malloc.h stdlib.h @comment malloc.h stdlib.h
@comment BSD @comment BSD
@deftypefun {void *} valloc (size_t @var{size}) @deftypefun {void *} valloc (size_t @var{size})
@ -790,6 +806,14 @@ immediately. This can be useful because otherwise a crash may happen
much later, and the true cause for the problem is then very hard to much later, and the true cause for the problem is then very hard to
track down. track down.
There is one problem with @code{MALLOC_CHECK_}: in SUID or SGID binaries
it could possibly be exploited since diverging from the normal programs
behaviour it now writes something to the standard error desriptor.
Therefore the use of @code{MALLOC_CHECK_} is disabled by default for
SUID and SGID binaries. It can be enabled again by the system
administrator by adding a file @file{/etc/suid-debug} (the content is
not important it could be empty).
So, what's the difference between using @code{MALLOC_CHECK_} and linking So, what's the difference between using @code{MALLOC_CHECK_} and linking
with @samp{-lmcheck}? @code{MALLOC_CHECK_} is orthogonal with respect to with @samp{-lmcheck}? @code{MALLOC_CHECK_} is orthogonal with respect to
@samp{-lmcheck}. @samp{-lmcheck} has been added for backward @samp{-lmcheck}. @samp{-lmcheck} has been added for backward

View File

@ -919,7 +919,7 @@ The file system type @var{fstype} is not known to the kernel.
The file @var{dev} is not a block device special file. The file @var{dev} is not a block device special file.
@item EBUSY @item EBUSY
@itemize @itemize @bullet
@item @item
The device is already mounted. The device is already mounted.
@ -933,7 +933,7 @@ The request is to remount read-only, but there are files open for write.
@end itemize @end itemize
@item EINVAL @item EINVAL
@itemize @itemize @bullet
@item @item
A remount was attempted, but there is no filesystem mounted over the A remount was attempted, but there is no filesystem mounted over the
@ -945,7 +945,7 @@ The supposed filesystem has an invalid superblock.
@end itemize @end itemize
@item EACCESS @item EACCESS
@itemize @itemize @bullet
@item @item
The filesystem is inherently read-only (possibly due to a switch on the The filesystem is inherently read-only (possibly due to a switch on the
@ -1190,4 +1190,3 @@ parameters are:
@item @item
@code{bdflush} @code{bdflush}
@end itemize @end itemize