Re: Fix and simplify -z noreloc-overflow" linker check in arch/x86/boot/compressed/Makefile

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 18, 2019 at 8:51 PM Sedat Dilek <sedat.dilek@xxxxxxxxx> wrote:
>
> On Mon, Mar 18, 2019 at 10:46 AM Masahiro Yamada
> <yamada.masahiro@xxxxxxxxxxxxx> wrote:
> [ ... ]
> > > ifeq ($(CONFIG_X86_64),y)
> > > KBUILD_LDFLAGS += $(call ld-option, -z noreloc-overflow)
> >
> >
> > Is this equivalent to
> >    $(LD) --help 2>&1 | grep -q "\-z noreloc-overflow" ... ?
>
> I tried with BFD (option exists and is set) and LLD (option does not
> exist, is not set).
>
> You do not think it is equivalent?


How about BFD (option does not exist) ?

cc-option, ld-option, and friends
check whether the exit code is zero or not.


ld shows a warning for unsupported "-v ...",
but returns 0 somehow.

But, it correctly returns 1 for the other
unsupported options.

I do not know why.


$ ld -v
GNU ld (GNU Binutils for Ubuntu) 2.26.1
$ ld --help 2>&1 | grep -q "\-z noreloc-overflow"
$ echo $?
1
$ ld -z noreloc-overflow -v
ld: warning: -z noreloc-overflow ignored.
GNU ld (GNU Binutils for Ubuntu) 2.26.1
$ echo $?
0
$ ld -mmy-machine -v
ld: unrecognised emulation mode: my-machine
Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 elf_iamcu
i386linux elf_l1om elf_k1om i386pep i386pe
$ echo $?
1




-- 
Best Regards
Masahiro Yamada



[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux