Fix forced allocation of common (-d) during -r links.
authorCary Coutant <ccoutant@gmail.com>
Mon, 19 Dec 2016 18:37:23 +0000 (10:37 -0800)
committerCary Coutant <ccoutant@gmail.com>
Mon, 19 Dec 2016 18:37:34 +0000 (10:37 -0800)
commit89ede9f53b74f84febcd1c2a6db8b03f390b62ec
tree3306b0e138f370414528b2d9091e99503e4b5e81
parent16e69324ec7fbe4ea12f2a0a069ad207ac8e3f97
Fix forced allocation of common (-d) during -r links.

If the .bss section has other data in it besides common allocations,
gold was subtracting the wrong section start address from the symbol
value.

gold/
PR gold/20976
* symtab.cc (Symbol_table::sized_write_globals): Use address of
output section, not input section.
* testsuite/Makefile.am (pr20976): New test case.
* testsuite/Makefile.in: Regenerate.
* testsuite/pr20976.c: New source file.
gold/ChangeLog
gold/symtab.cc
gold/testsuite/Makefile.am
gold/testsuite/Makefile.in
gold/testsuite/pr20976.c [new file with mode: 0644]