This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

MacOS: objdump: Reading section .bss failed because: memory exhausted

Dear Community,

What does the error mean? 

The error was introduced after a:  brew cask upgrade

The tools got updated from 7 to 9 -> arm-none-eabi-objdump --version

GNU objdump (GNU Tools for Arm Embedded Processors 9-2019-q4-major)  

2.33.1.20191025

lib-h3 % arm-none-eabi-objdump -D lib_h3/libh3.a  | 

arm-none-eabi-c++filt > lib_h3/lib.list

arm-none-eabi-objdump: error: lib_h3/libh3.a(h3_codec.o)(.bss) section size (0x800c bytes) is larger than file size (0xde8 bytes)

arm-none-eabi-objdump: Reading section .bss failed because: memory exhausted

arm-none-eabi-objdump: error: lib_h3/libh3.a(udp.o)(.bss) section size (0x19934 bytes) is larger than file size (0xcfc bytes)

arm-none-eabi-objdump: Reading section .bss failed because: memory exhausted

lib-h3 % echo $?                                                                         

0

lib-h3 % ls -al build_h3/src/h3_codec.o                                             

-rwx------  1 arjanvanvught  staff  3560  7 apr 17:50 build_h3/src/h3_codec.o

The file size of the object file is 3560 bytes which is the (0xde8 bytes) as mentioned in the error. Why would there be an error or even better; why would there be any relationship between the allocated bytes in .bss and the object file size? 

Many thanks in advance, Arjan

Parents
  • I can reproduce it with a setup shown below. Note that the error isn't fatal to the command's execution. Is there any chance your scripts could be persuaded to use objdump -d instead of objdump -D?

    /* 1.s */
    .text
    .global _start
    _start:
    	nop
    
    .section .text2, "ax", @progbits
    _func:
    	nop

    /* 1.ld */
    ENTRY(_start)
    
    SECTIONS
    {
      .text : {*(.text);}
      .bss : {. += 0x8000;}
      .text2 : AT (LOADADDR(.text) + SIZEOF(.text)) {*(.text2);}
    }

      

    [user@mach tmp]$ as 1.s -o 1.o
    [user@mach tmp]$ ld -T 1.ld 1.o
    [user@mach tmp]$ objdump -D a.out
    
    a.out:     file format elf64-x86-64
    
    
    Disassembly of section .text:
    
    0000000000000000 <_start>:
       0:	90                   	nop
    objdump: error: a.out(.bss) section size (0x8000 bytes) is larger than file size (0x12b0 bytes)
    objdump: Reading section .bss failed because: memory exhausted
    
    Disassembly of section .text2:
    
    0000000000008001 <_func>:
        8001:	90                   	nop

Reply
  • I can reproduce it with a setup shown below. Note that the error isn't fatal to the command's execution. Is there any chance your scripts could be persuaded to use objdump -d instead of objdump -D?

    /* 1.s */
    .text
    .global _start
    _start:
    	nop
    
    .section .text2, "ax", @progbits
    _func:
    	nop

    /* 1.ld */
    ENTRY(_start)
    
    SECTIONS
    {
      .text : {*(.text);}
      .bss : {. += 0x8000;}
      .text2 : AT (LOADADDR(.text) + SIZEOF(.text)) {*(.text2);}
    }

      

    [user@mach tmp]$ as 1.s -o 1.o
    [user@mach tmp]$ ld -T 1.ld 1.o
    [user@mach tmp]$ objdump -D a.out
    
    a.out:     file format elf64-x86-64
    
    
    Disassembly of section .text:
    
    0000000000000000 <_start>:
       0:	90                   	nop
    objdump: error: a.out(.bss) section size (0x8000 bytes) is larger than file size (0x12b0 bytes)
    objdump: Reading section .bss failed because: memory exhausted
    
    Disassembly of section .text2:
    
    0000000000008001 <_func>:
        8001:	90                   	nop

Children