Summary: | objcopy does not update sh_link correctly | ||
---|---|---|---|
Product: | binutils | Reporter: | Andreas Schwab <schwab> |
Component: | binutils | Assignee: | unassigned |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | bug-binutils, hjl.tools |
Priority: | P2 | ||
Version: | 2.17 | ||
Target Milestone: | --- | ||
Host: | Target: | ia64-*-* | |
Build: | Last reconfirmed: | ||
Attachments: |
Test object
Output of objcopy -g |
Description
Andreas Schwab
2005-12-07 16:55:55 UTC
Created attachment 782 [details]
Test object
Created attachment 783 [details]
Output of objcopy -g
The problem is that elf_discarded_section points to the input section, but this is not the linker. A patch is posted at http://sourceware.org/ml/binutils/2005-12/msg00058.html http://sourceware.org/ml/binutils/2005-12/msg00056.html is similar. But it doesn't handle a section is removed by "-R". A similar problem can be seen on older dynamic objects. When stripping debug sections, section syms for the removed sections are not removed from .dynsym, because strip doesn't touch .dynsym. This leaves symbols with invalid st_shndx fields. Dynamic objects created with newer binutils avoid the problem to some extent by not emitting dynamic section syms for debug sections. I am closing this bug. If we really want to handle .dynsym in DSOs created by old linker, we can open a new bug report. |