bug-binutils
[Top][All Lists]
Advanced

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

[Bug gas/27169] i386: Emit R_386_PLT32 instead of R_386_PC32 for `call/j


From: i at maskray dot me
Subject: [Bug gas/27169] i386: Emit R_386_PLT32 instead of R_386_PC32 for `call/jmp foo`
Date: Mon, 11 Jan 2021 02:26:03 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=27169

--- Comment #7 from Fangrui Song <i at maskray dot me> ---
Applied your R_386_PLT32 patch.

# of unexpected failures        6

make -C Debug check-ld RUNTESTFLAGS=ld-shared/shared.exp # passed for me.

ld/testsuite/ld-i386/pr20515.d is an expected failure due to no-longer-relevant
diagnostic. It can be repaired by using .reloc .-4, R_386_PC32, foo-4

#error: unsupported non-PIC call to IFUNC `foo'

For
ld/testsuite/ld-i386/pr19636-2a.d (I think bcd are similar)
both gold and LLD export undefined weak foo in .dynsym, regardless of
R_386_PC32/R_386_PLT32.
GNU ld exports undefined weak foo for R_386_PC32 but not for R_386_PLT32.
I think there is some simplification which can be made.

Branch relocations to undefined weak symbols have varying behaviors across
architectures (e.g. some resolve it to the current pc, some resolve it to
link-time 0, ppc32 might resolve it to the beginning of text segment/section (I
forgot the details but it is strange)). In addition, I don't think users
understand or use dynamic-undefined-weak in practice, so altering the 2017
changed behavior should not be a problem...

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]