This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] PR ld/19636: [x86] Resolve undefweak and defined symbols in executable
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Michael Matz <matz at suse dot de>
- Cc: Cary Coutant <ccoutant at gmail dot com>, Binutils <binutils at sourceware dot org>
- Date: Fri, 26 Feb 2016 04:51:16 -0800
- Subject: Re: [PATCH] PR ld/19636: [x86] Resolve undefweak and defined symbols in executable
- Authentication-results: sourceware.org; auth=none
- References: <20160223175814 dot GA2858 at intel dot com> <alpine dot LSU dot 2 dot 20 dot 1602241541430 dot 20277 at wotan dot suse dot de> <CAMe9rOoxU43=dhGYZZGQtWhfbU-sGRoaiiJ7PfPNtzSc05-t-A at mail dot gmail dot com> <alpine dot LSU dot 2 dot 20 dot 1602241552020 dot 20277 at wotan dot suse dot de> <CAMe9rOpEWKVVP=-o0t0emkjKR0-xqnn-YZ5C5nfa=0E4BkEZaw at mail dot gmail dot com> <alpine dot LSU dot 2 dot 20 dot 1602241709410 dot 20277 at wotan dot suse dot de> <CAMe9rOr5qa_PBJA3oDENWErRfrojtzC1ncXaWwyh-1EAczPn-g at mail dot gmail dot com> <alpine dot LSU dot 2 dot 20 dot 1602241749340 dot 20277 at wotan dot suse dot de> <CAMe9rOrSNYV_x-5aU7K+hXHNrinE9Co8y1F5VUkY+SoRQize=g at mail dot gmail dot com> <alpine dot LSU dot 2 dot 20 dot 1602241753490 dot 20277 at wotan dot suse dot de> <CAMe9rOpZNHtKRvx+5QurEOcVU96WEQuBRPJ6UorocjE-8Jd+vQ at mail dot gmail dot com> <alpine dot LSU dot 2 dot 20 dot 1602241808400 dot 20277 at wotan dot suse dot de> <CAMe9rOpAkC238Gvji0rf1_wBqEAZDDeTkhp_o-BirUrTa622aA at mail dot gmail dot com> <alpine dot LSU dot 2 dot 20 dot 1602241843180 dot 20277 at wotan dot suse dot de> <CAJimCsG=1u_yM6SBFAxCxB4JvWtxO5fZ22+OmG6UC_RYON3DdA at mail dot gmail dot com> <alpine dot LSU dot 2 dot 20 dot 1602251356320 dot 20277 at wotan dot suse dot de> <CAMe9rOo47bdn23=_aRpP8D5-pY1Jd=6_1+yYnAW=qD6EZ8cwJw at mail dot gmail dot com>
On Thu, Feb 25, 2016 at 10:59 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> Here is the updated patch I am testing. The linker behavior is changed
> in 2 cases when creating executable:
>
> 1. When there are mixed PIC and non-PIC references to undefined
> weak symbols, undefined weak symbols are resolved to 0 at link-time.
> 2. If all references to undefined weak symbols are PIC, dynamic
> relocations against undefined weak symbols will be generated unless
> -z nodynamic-undefined-weak is passed to linker.
>
> BTW, We have to resolve R_X86_64_32/R_X86_64_PC32 relocations
> against undefined weak symbols to zero. Otherwise, we will get run-time
> relocation overflow for dynamic R_X86_64_32/R_X86_64_PC32 relocations.
>
This is what I am checking in.
--
H.J.
Attachment:
0001-x86-Resolve-non-PIC-undefweak-symbols-in-executable.patch
Description: Binary data