This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: ld/2338: objdump -d -l doesn't work correctly
On Mon, Feb 20, 2006 at 03:21:21PM +0100, Eric Botcazou wrote:
> > There's a bit of nasty code to do this that I added to GDB, for
> > basically the same reason. It's in symfile.c:place_section.
>
> I presume it's the following lines:
>
> /* For relocatable files, all loadable sections will start at zero.
> The zero is meaningless, so try to pick arbitrary addresses such
> that no loadable sections overlap. This algorithm is quadratic,
> but the number of sections in a single object file is generally
> small. */
> if ((bfd_get_file_flags (objfile->obfd) & (EXEC_P | DYNAMIC)) == 0)
> {
> struct place_section_arg arg;
> arg.offsets = objfile->section_offsets;
> arg.lowest = 0;
> bfd_map_over_sections (objfile->obfd, place_section, &arg);
> }
>
> Note that the comment seems to be overlooking -ffunction-sections.
Well, generally the number of functions in a single source file is
adequately small that there isn't a problem. If someone wanted to
unquadraticify the algorithm, I wouldn't complain...
--
Daniel Jacobowitz
CodeSourcery