mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-23 01:53:38 +08:00
bfd: Define pagesize variables only for mmap
Define _bfd_pagesize, _bfd_pagesize_m1 and _bfd_minimum_mmap_size only if HAVE_MMAP is defined. * libbfd-in.h (_bfd_pagesize): Declare only if HAVE_MMAP is defined. (_bfd_pagesize_m1): Likewise. (_bfd_minimum_mmap_size): Likewise. * libbfd.c (_bfd_pagesize): Define only if HAVE_MMAP is defined. (_bfd_pagesize_m1): Likewise. (_bfd_minimum_mmap_size): Likewise. (bfd_init_pagesize): Likewise. * lynx-core.c (lynx_core_file_p): Replace _bfd_pagesize with getpagesize.
This commit is contained in:
parent
cd714ac07c
commit
56756c571e
@ -848,9 +848,11 @@ extern bfd_byte * _bfd_write_unsigned_leb128
|
||||
extern struct bfd_link_info *_bfd_get_link_info (bfd *)
|
||||
ATTRIBUTE_HIDDEN;
|
||||
|
||||
#ifdef HAVE_MMAP
|
||||
extern uintptr_t _bfd_pagesize ATTRIBUTE_HIDDEN;
|
||||
extern uintptr_t _bfd_pagesize_m1 ATTRIBUTE_HIDDEN;
|
||||
extern uintptr_t _bfd_minimum_mmap_size ATTRIBUTE_HIDDEN;
|
||||
#endif
|
||||
|
||||
#if GCC_VERSION >= 7000
|
||||
#define _bfd_mul_overflow(a, b, res) __builtin_mul_overflow (a, b, res)
|
||||
|
@ -1572,6 +1572,7 @@ _bfd_generic_init_private_section_data (bfd *ibfd ATTRIBUTE_UNUSED,
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef HAVE_MMAP
|
||||
uintptr_t _bfd_pagesize;
|
||||
uintptr_t _bfd_pagesize_m1;
|
||||
uintptr_t _bfd_minimum_mmap_size;
|
||||
@ -1587,3 +1588,4 @@ bfd_init_pagesize (void)
|
||||
/* The minimum section size to use mmap. */
|
||||
_bfd_minimum_mmap_size = _bfd_pagesize * 4;
|
||||
}
|
||||
#endif
|
||||
|
@ -854,9 +854,11 @@ extern bfd_byte * _bfd_write_unsigned_leb128
|
||||
extern struct bfd_link_info *_bfd_get_link_info (bfd *)
|
||||
ATTRIBUTE_HIDDEN;
|
||||
|
||||
#ifdef HAVE_MMAP
|
||||
extern uintptr_t _bfd_pagesize ATTRIBUTE_HIDDEN;
|
||||
extern uintptr_t _bfd_pagesize_m1 ATTRIBUTE_HIDDEN;
|
||||
extern uintptr_t _bfd_minimum_mmap_size ATTRIBUTE_HIDDEN;
|
||||
#endif
|
||||
|
||||
#if GCC_VERSION >= 7000
|
||||
#define _bfd_mul_overflow(a, b, res) __builtin_mul_overflow (a, b, res)
|
||||
|
@ -96,7 +96,7 @@ lynx_core_file_p (bfd *abfd)
|
||||
asection *newsect;
|
||||
size_t amt;
|
||||
|
||||
pagesize = _bfd_pagesize; /* Serious cross-target issue here... This
|
||||
pagesize = getpagesize (); /* Serious cross-target issue here... This
|
||||
really needs to come from a system-specific
|
||||
header file. */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user