Summary: | Symbols based on MEMORY regions confuse --gc-sections. | ||
---|---|---|---|
Product: | binutils | Reporter: | Nick Bowler <nbowler> |
Component: | ld | Assignee: | Alan Modra <amodra> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 2.32 | ||
Target Milestone: | 2.32 | ||
Host: | Target: | ||
Build: | Last reconfirmed: | 2018-09-19 00:00:00 | |
Attachments: | Possible patch |
Description
Nick Bowler
2018-09-13 14:10:49 UTC
Created attachment 11243 [details]
Possible patch
Simply moving the call to lang_do_memory_regions earlier in lang_process is sufficient to make the example case work as expected.
Unsure if this is a good idea though.
The master branch has been updated by Alan Modra <amodra@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7f0cfc6eb8bbead5c9a1ff3a8dec11d93304f5ad commit 7f0cfc6eb8bbead5c9a1ff3a8dec11d93304f5ad Author: Alan Modra <amodra@gmail.com> Date: Wed Sep 19 13:22:43 2018 +0930 PR23648, Symbols based on MEMORY regions confuse --gc-sections Running lang_do_memory_regions earlier seems a reasonable solution to gaining better values for symbols prior to lang_gc_sections. PR ld/23648 * ldlang.c (lang_process): Move lang_do_memory_regions earlier. Comment on lang_do_assignments call. * ldgram.y (origin_exp): Don't assign region->current. I'll commit a ld testsuite test too once my multi-target test run completes (again). The master branch has been updated by Alan Modra <amodra@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7e00df65a4e3e281604acab2450812a5fb275743 commit 7e00df65a4e3e281604acab2450812a5fb275743 Author: Alan Modra <amodra@gmail.com> Date: Wed Sep 19 16:07:44 2018 +0930 PR23648 testcase PR 23648 * testsuite/ld-elf/pr23648.d, * testsuite/ld-elf/pr23648.s, * testsuite/ld-elf/pr23648.t: New test. |