Skip to content
Commit 20f3da11 authored by Davide Italiano's avatar Davide Italiano
Browse files

[ELF/X86_64] Fix handling of R_X86_64_GOTTPOFF relocation.

The aforementioned relocation generate a GOT entry with a
R_X86_64_TPOFF64. The new relocation is processed at startup
time by the loader. lld didn't generate the outstanding relocation,
now it does. This bug was found while trying to link ls(1) on FreeBSD.

Simplified repro:
#include <stdio.h>
#include <wchar.h>
#include <wctype.h>

int
main(void)
{
    wchar_t wc = 98;
    if (!iswprint(wc))
        printf("blah\n");
    else
        printf("foo\n");
    return (0);
}

which incorrectly outputs "blah" when linked with lld before this patch.

llvm-svn: 233051
parent 70a1b816
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment