BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002274 [buildroot] Other crash always 02-20-08 12:11 02-20-08 12:11
Reporter stigpo View Status public  
Assigned To buildroot
Priority normal Resolution open  
Status assigned   Product Version
Summary 0002274: [PATCH] elf2flt produces bad relocation information with certain input
Description elf2flt will produce wrong results if there are multiple local symbols with the same name in the symbol table. This was discovered when compiling and linking busybox 1.9.1 with an generic ARM toolchain.

The bug is caused by the way elf2flt resolves symbol names, assuming that the symbols names are unique instead of relying on the information provided by BFD. I am not sure why we need to do symbol name lookup at all, so I left a warning in this patch to give a heads up to those hitting this relocation problem, and let them consider the correctness. The new default will at least provide better results for the tests I have done (i.e. busybox compiles and my other programs works as before).

Additional Information Problem seen in libbb/lineedit.c:input_backward where the following line produces an assembly that provokes the issue (together with others that does something similar):

printf("\b\b\b\b" + (4 - num));

The key is to make the relocation relative to a local symbol (i.e .LC0). If more than one unit produces relocations relative to a local symbol the elf2flt relocation will fail.

I have 6 such relocation bugs with my configuration of busybox (leaving in as much as possible on a NOMMU system) and 5 of those are matched to the wrong .LC0 the last to .LC6.
Attached Files  elf2flt-arm-local-reloc.patch [^] (1,424 bytes) 02-20-08 12:11

- Relationships

There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
02-20-08 12:11 stigpo New Issue
02-20-08 12:11 stigpo Status new => assigned
02-20-08 12:11 stigpo Assigned To  => buildroot
02-20-08 12:11 stigpo File Added: elf2flt-arm-local-reloc.patch


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker