ARM mapping symbols and --strip-unneeded

Nick Clifton nickc@redhat.com
Mon Jun 27 10:57:00 GMT 2016


Hi Michael,

> So, is it reasonable to assume that ld relies on the mapping symbols
> when producing output for big-endian ARM

Yes.  See bfd/elf32-arm.c:elf32_arm_write_section() for more details.

> Based on this I'm wondering about the definition of "unneeded" (being:
> "Remove all symbols that are not needed for relocation processing."):
> Should the mapping symbols perhaps be considered needed and not
> stripped?

For big-endian ARM binaries, yes.

> In the meaintime: Is there another way than --preserve-symbol= to tell
> strip to preserve mapping symbols?

If you are able to add command line options to the build system then you
could try adding --no-strip-unneeded.  Alternatively you could add "@extra_stript_options"
and then in the file extra_strip_options have --preserve-symbol=$a etc.
That should avoid the shell processing problems.

(I would also argue that the build system is broken in that it is stripping
files too early.  But there is probably nothing that can be done about that).

As an alternative, you might like to try out the attached patch, which
should prevent the mapping symbols from being stripped in the first place.
Unfortunately this does have the drawback of making stripped big endian binaries
bigger than their little endian counterparts.

If this patch does work for you, and you are unable to use any of the workarounds
suggested above, then please could you open a bug report for this problem, so
that we have somewhere to record the patch and the problem that it is fixing.

Cheers
  Nick

-------------- next part --------------
A non-text attachment was scrubbed...
Name: elf32-arm.c.patch
Type: text/x-patch
Size: 1567 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20160627/59bcfcc2/attachment.bin>


More information about the Binutils mailing list