# Erroneous symbol table

**URL:** https://forums.sifive.com/t/erroneous-symbol-table/1341
**Category:** General
**Created:** [June 25, 2018, 1:46pm UTC](https://forums.sifive.com/t/erroneous-symbol-table/1341 "2018-06-25T13:46:47Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jmonesti](https://avatars.discourse-cdn.com/v4/letter/j/aca169/32.png) [@jmonesti](https://forums.sifive.com/u/jmonesti)
#### Post date: [June 25, 2018, 1:46pm UTC](https://forums.sifive.com/t/erroneous-symbol-table/1341/1 "2018-06-25T13:46:47Z")

</div>

Hello

I recently downloaded the h.264 reference code from Fraunhofer ( [http://iphome.hhi.de/suehring/](http://iphome.hhi.de/suehring/) ), and built it using berkely riscv-unknown-elf-gcc (-O2 -march=rv32imac -mabi=ilp32)

I’m focusing on code size, and both riscv-unknown-elf-readelf / riscv-unknown-elf-nm show some functions to be 0xfffffffe bytes long !?

‘riscv-unknown-elf-objdump -d’ shows these functions to be a single, 16b ‘ret’

.elf available on-demand (can’t upload it), functions init\_time / interpret\_user\_data\_registered\_itu\_t\_t35\_info / interpret\_full\_frame\_freeze\_release\_info, for instance

‘riscv-unknown-elf-readelf -s ldecode.exe | grep fffffffe’ exhibits the bug

Is this a known bug in the toolchain ? A misuse on my side ?

Plz let me know

–  
Jean-François

---

<div class="post-metadata">

### Author: ![jimw](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@jimw](https://forums.sifive.com/u/jimw)
#### Post date: [June 25, 2018, 3:52pm UTC](https://forums.sifive.com/t/erroneous-symbol-table/1341/2 "2018-06-25T15:52:32Z")

</div>

Yes, there are known bugs with symbol sizes. This is due to the linker relaxation support which can delete instructions at link time. This requires updating symbol addresses and sizes while deleting code, and this gets tricky because there are complicated interactions with other linker features. This has been fixed in the upstream FSF tree, but there were multiple patches required to get this right, so the only source tree that gets this right at the moment is the top of the FSF binutils tree.

If you have a recent enough source tree, e.g. binutils-2.30, then you might be able to fix it by backporting a few patches. These patches may eventually get backported into the riscv-gnu-toolchain binutils-2.30 branch.

See for instance  
[https://sourceware.org/bugzilla/show\_bug.cgi?id=22756](https://sourceware.org/bugzilla/show_bug.cgi?id=22756)

---

<div class="post-metadata">

### Author: ![jmonesti](https://avatars.discourse-cdn.com/v4/letter/j/aca169/32.png) [@jmonesti](https://forums.sifive.com/u/jmonesti)
#### Post date: [June 26, 2018, 8:53am UTC](https://forums.sifive.com/t/erroneous-symbol-table/1341/3 "2018-06-26T08:53:01Z")

</div>

Ok, I see

Thank you for your prompt response

–  
Jean-François
