Project:Toolchain/Binutils 2.34 porting notes/undefined reference to bfd get section *

= The problem = Starting from binutils-2.34 macros to access section attributes changed slightly: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=fd3619828e94a24a92cddec42cbc0ab33352eeb4

Code like the following will fail to build:

linux/bfd.c:125:36: warning: implicit declaration of function 'bfd_get_section_vma'; did you mean 'bfd_set_section_vma'? [-Wimplicit-function-declaration] 125 |        uintptr_t vma = (uintptr_t)bfd_get_section_vma(bfdh, section); |                                   bfd_set_section_vma ld: bfd.c:(.text+0x4ff): undefined reference to `bfd_get_section_vma'

= The fix =

The fix is simple: just drop  and   parameters:

= Links and examples =

- Upstream commit: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=fd3619828e94a24a92cddec42cbc0ab33352eeb4 - Example fix: