# PYNQ Microblaze project Make error

**URL:** <https://discuss.pynq.io/t/pynq-microblaze-project-make-error/449>\
**Category:** Support\
**Created:** [September 10, 2019, 1:02pm UTC](https://discuss.pynq.io/t/pynq-microblaze-project-make-error/449 "2019-09-10T13:02:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Y\_H](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/y_h/32/178_2.png) [@Y\_H](https://discuss.pynq.io/u/Y_H)\
**Post date:** [September 10, 2019, 1:02pm UTC](https://discuss.pynq.io/t/pynq-microblaze-project-make-error/449/1 "2019-09-10T13:02:25Z")

</div>

Hi everyone,

I’m trying to build the PMOD microblaze project using the process described here:  
[https://pynq.readthedocs.io/en/v2.4/overlay\_design\_methodology/pynq\_microblaze\_subsystem.html](https://pynq.readthedocs.io/en/v2.4/overlay_design_methodology/pynq_microblaze_subsystem.html)

In particular, the “Building the Projects” chapter.

The “make” command ends with the following error:

> ‘Building target: pmod\_adc.elf’  
> ‘Invoking: MicroBlaze gcc linker’  
> mb-gcc -Wl,-T -Wl,…/src/lscript.ld -L…/…/bsp\_iop\_pmod/iop\_pmoda\_mb/lib -mlittle-endian -mcpu=v10.0 -mxl-soft-mul -Wl,–no-relax -o “pmod\_adc.elf” ./src/ad7991.o ./src/pmod\_adc.o -Wl,–start-group,-lxil,-lgcc,-lc,–end-group  
> c:/xilinx/sdk/2018.3/gnu/microblaze/nt/bin/…/lib/gcc/microblaze-xilinx-elf/7.3.1/…/…/…/…/microblaze-xilinx-elf/bin/ld.exe: pmod\_adc.elf section `.rodata' will not fit in region `iop1\_mb1\_lmb\_lmb\_bram\_if\_cntlr’  
> c:/xilinx/sdk/2018.3/gnu/microblaze/nt/bin/…/lib/gcc/microblaze-xilinx-elf/7.3.1/…/…/…/…/microblaze-xilinx-elf/bin/ld.exe: region `iop1\_mb1\_lmb\_lmb\_bram\_if\_cntlr’ overflowed by 4088 bytes  
> collect2.exe: error: ld returned 1 exit status  
> make[1]: \*\*\* [makefile:38: pmod\_adc.elf] Error 1  
> make[1]: Leaving directory ‘C:/Users/…/master/pynq/lib/pmod/pmod\_adc/Debug’  
> make: \*\*\* [makefile:34: pmod\_adc.bin] Error 2

I could not find how to extract the ELF file to check the reason for the overflow.

This is the default pynq-z1 project.

- Has anybody faced this problem?
- I’m surprised the default project can not fit in the BRAM. The BRAM size I have in Vivado is 64K, Should I increase it, or Is there any building option to modify to have a smaller elf file?

Thanks!

---

<div class="post-metadata">

**Author:** ![rock](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/rock/32/32_2.png) [@rock](https://discuss.pynq.io/u/rock)\
**Post date:** [September 12, 2019, 5:00pm UTC](https://discuss.pynq.io/t/pynq-microblaze-project-make-error/449/2 "2019-09-12T17:00:30Z")

</div>

You don’t need to increase BRAM size.

Add the flag  
`-Wl,-gc-sections`

to the mb-gcc call at:

> <https://github.com/Xilinx/PYNQ/blob/master/pynq/lib/pmod/pmod_adc/Debug/makefile#L38>

This should be fixed in image v2.5.
