Linux-Next Archive on lore.kernel.org
 help / color / Atom feed
From: Alex Ghiti <alex@ghiti.fr>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	Alexei Starovoitov <ast@kernel.org>,
	linux-next@vger.kernel.org, Zong Li <zong.li@sifive.com>,
	Palmer Dabbelt <palmerdabbelt@google.com>
Subject: Re: [PATCH] powerpc: Do not consider weak unresolved symbol relocations as bad
Date: Thu, 16 Jan 2020 14:49:19 -0500
Message-ID: <ed319b1f-c6f4-7bad-f946-6c01fb202c7c@ghiti.fr> (raw)
In-Reply-To: <20200116103932.2e603cf9@canb.auug.org.au>

Hi Stephen,

On 1/15/20 6:39 PM, Stephen Rothwell wrote:
> Hi Alexandre,
>
> Thanks for sorting this out.  Just a few comments below.
>
> On Wed, 15 Jan 2020 15:46:48 -0500 Alexandre Ghiti <alex@ghiti.fr> wrote:
>>   
>>   # Have Kbuild supply the path to objdump so we handle cross compilation.
>                                              ^
> "and nm"
>
>> +# Remove from the bad relocations those that match an undefined weak symbol
>> +# which will result in an absolute relocation to 0.
>> +# Weak unresolved symbols are of that form in nm output:
>> +# "                  w _binary__btf_vmlinux_bin_end"
>> +undef_weak_symbols=$($nm "$vmlinux" | awk -e '$1 ~ /w/ { print $2 }')
>> +
>> +while IFS= read -r weak_symbol; do
>> +	bad_relocs="$(echo -n "$bad_relocs" | sed "/$weak_symbol/d")"
>> +done <<< "$undef_weak_symbols"
> This is not a bash script, and the above is a bashism :-(
> Also, my version of awk (mawk) doesn't have a -e option.
>
> How about something like :
>
> undef_weak_symbols=$($nm "$vmlinux" | awk '$1 ~ /w/ { print $2 }')
> if [ "$undef_weak_symbols" ]; then
> 	bad_relocs="$(echo "$bad_relocs" | grep -F -w -v "$undef_weak_symbols")"
> fi
>
> Or do this near the top and add the grep to the others.

Yes that's quite better, thanks, I'll send a new version tomorrow.

Thanks again,

Alex


      reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-15 20:46 Alexandre Ghiti
2020-01-15 23:39 ` Stephen Rothwell
2020-01-16 19:49   ` Alex Ghiti [this message]

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ed319b1f-c6f4-7bad-f946-6c01fb202c7c@ghiti.fr \
    --to=alex@ghiti.fr \
    --cc=ast@kernel.org \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=palmerdabbelt@google.com \
    --cc=paulus@samba.org \
    --cc=sfr@canb.auug.org.au \
    --cc=zong.li@sifive.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Next Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-next/0 linux-next/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-next linux-next/ https://lore.kernel.org/linux-next \
		linux-next@vger.kernel.org
	public-inbox-index linux-next

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-next


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git