This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

segmentation fault with --relax option, avr target


Hi,

I encountered a segmentation fault (dereferencing NULL pointer) with
binutils-2.22 (avr target).
- it occurs when --relax option is enabled
- it occurred in file elf32-avr.c:1537 (function:
elf32_avr_relax_delete_bytes)

While debugging I found the difference in "relocs" field of "struct
bfd_section" member "used_by_bfd".

binutils-2.21
ldlang.c:6419  open_input_bfds (statement_list.head, FALSE);

binutils-2.22
ldlang.c:6570  open_input_bfds (statement_list.head, OPEN_BFD_NORMAL);

After above open_input_bfds function call in ldlang.c, "relocs" field of
sections are NULL in binutils-2.22.

Is this expected?

'relocs' field is updated in elflink.c:_bfd_elf_link_read_relocs
function.
In my case, for few sections 'relocs' field is not updated.

Is 'relocs' expected to be NULL for unused sections?
If so, referring 'relocs' field in 'elf32_avr_relax_delete_bytes'
function correct?

Thanks,
Pitchumani.S


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]