Re: build failure after commit eb0481bbc4ce ("objtool: Fix reloc_hash size")

From: Michal Kubecek
Date: Wed Jun 28 2023 - 12:06:39 EST


On Wed, Jun 28, 2023 at 05:44:32PM +0200, Michal Kubecek wrote:
> On Wed, Jun 28, 2023 at 08:16:54AM -0700, Josh Poimboeuf wrote:
> > Interesting. Can you add the below patch and also do:
> >
> > make net/ipv4/netfilter/iptable_nat.o OBJTOOL_ARGS="--stats"
> >
> > and report the output?
>
> With these, I get
>
> ...
> CC [M] net/ipv4/netfilter/iptable_nat.o
> nr_sections: 40
> section_bits: 10
> nr_symbols: 41
> symbol_bits: 10
> mmap reloc: Invalid argument
> make[1]: Leaving directory '/srv/ram/kobj'

Not sure if it's of any use but I also tried to run it under strace and
the failed mmap() call seems to be

18761 mmap(NULL, 0, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 EINVAL (Invalid argument)

Perhaps the problem could be that elf->num_relocs may be zero?

Michal