[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Some OpenWrt port related problems
From: |
Eli Zaretskii |
Subject: |
Re: Some OpenWrt port related problems |
Date: |
Sat, 01 Jan 2011 17:34:18 +0200 |
> From: David Kuehling <address@hidden>
> Date: Sat, 01 Jan 2011 15:20:58 +0100
> Cc: address@hidden, Emacs Dev <address@hidden>
>
> Loading ediff-hook...
> Finding pointers to doc strings...
> Finding pointers to doc strings...done
> emacs: Can't allocate buffer for /usr/bin/emacs
>
> So it wants to pull a full copy of the emacs binary into memory?
It tries to mmap it, yes:
old_file_size = stat_buf.st_size;
old_base = mmap (NULL, old_file_size, PROT_READ | PROT_WRITE,
MAP_ANON | MAP_PRIVATE, mmap_fd, 0);
if (old_base == MAP_FAILED)
fatal ("Can't allocate buffer for %s\n", old_name, 0);
> $ echo "1" > /proc/sys/vm/overcommit_memory
> $ emacs -Q --batch --eval \
> '(dump-emacs "./demacs" "/usr/bin/emacs")'
>
> [..]
> Finding pointers to doc strings...
> Finding pointers to doc strings...done
> emacs: Program segment above .bss in /usr/bin/emacs
>
> So what's that supposed to mean?
This message comes from this portion of unexelf.c:
/* Fix up a new program header. Extend the writable data segment so
that the bss area is covered too. Find that segment by looking
for a segment that ends just before the .bss area. Make sure
that no segments are above the new .data2. Put a loop at the end
to adjust the offset and address of any segment that is above
data2, just in case we decide to allow this later. */
for (n = new_file_h->e_phnum - 1; n >= 0; n--)
{
/* Compute maximum of all requirements for alignment of section. */
ElfW(Word) alignment = (NEW_PROGRAM_H (n)).p_align;
if ((OLD_SECTION_H (old_bss_index)).sh_addralign > alignment)
alignment = OLD_SECTION_H (old_bss_index).sh_addralign;
#ifdef __sgi
/* According to address@hidden (Karsten Kuenne)
and address@hidden (Alexandre Oliva), on IRIX 5.2, we
always get "Program segment above .bss" when dumping
when the executable doesn't have an sbss section. */
if (old_sbss_index != -1)
#endif /* __sgi */
if (NEW_PROGRAM_H (n).p_vaddr + NEW_PROGRAM_H (n).p_filesz
> (old_sbss_index == -1
? old_bss_addr
: round_up (old_bss_addr, alignment)))
fatal ("Program segment above .bss in %s\n", old_name, 0);
I don't know enough about unexelf, nor about ELF in general, to tell
what this means or what to do about this, though. Anyone?