1
1
mirror of https://github.com/rui314/mold.git synced 2024-11-15 14:36:25 +03:00
This commit is contained in:
Rui Ueyama 2021-01-25 11:02:01 +09:00
parent dbc666d2bf
commit 3489a464c6
39 changed files with 77 additions and 77 deletions

View File

@ -265,8 +265,8 @@ void ObjectFile::read_ehframe(InputSection &isec) {
while (!rels.empty() && rels[0].r_offset < end_offset) {
if (id && first_global <= rels[0].r_sym)
Fatal() << isec << ": FDE with non-local relocations is not supported";
Symbol &sym = *symbols[rels[0].r_sym];
Symbol &sym = *symbols[rels[0].r_sym];
eh_rels.push_back(EhReloc{sym, rels[0].r_type,
(u32)(rels[0].r_offset - begin_offset),
rels[0].r_addend});

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -31,4 +31,4 @@ readelf --dynamic $t/exe > $t/readelf
fgrep -q 'Shared library: [libfoo.so]' $t/readelf
! fgrep -q 'Shared library: [libbar.so]' $t/readelf
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -10,4 +10,4 @@ echo '.globl loop; loop: jmp loop' | cc -o $t/b.o -c -x assembler -
objdump -d $t/exe > /dev/null
file $t/exe | grep -q ELF
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -38,4 +38,4 @@ EOF
$t/exe | grep -q '42 42 1'
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -39,4 +39,4 @@ readelf --symbols $t/exe > $t/log
! fgrep -q foo $t/log
! fgrep -q .Lbar $t/log
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -14,4 +14,4 @@ EOF
! ../mold -o $t/exe $t/a.o $t/a.o 2> $t/log
grep -q 'duplicate symbol: .*\.o: .*\.o: main' $t/log
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -56,4 +56,4 @@ Symbol table for image:
2 2: 0000000000000000 204 FUNC GLOBAL DEFAULT UND printf
"
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -20,4 +20,4 @@ grep -q 'Entry point address:.*0x201010' $t/log
readelf -e $t/exe > $t/log
grep -q 'Entry point address:.*0x201018' $t/log
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -21,4 +21,4 @@ $t/exe
clang++ -fuse-ld=`pwd`/../mold -o $t/exe $t/a.cc
$t/exe
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -45,4 +45,4 @@ Symbol table '.dynsym' contains 19 entries:
18: 0000000000202178 0 NOTYPE GLOBAL DEFAULT ABS _edata
"
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -46,4 +46,4 @@ hexdump -C $t/exe2 > $t/txt2
diff -q $t/txt1 $t/txt2
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -51,4 +51,4 @@ cat $t/log.2 | grep -q '0000000000000000 .* unused_var1'
cat $t/log.2 | grep -q '0000000000000000 .* unused_var2'
$t/exe2 | grep -q '1 2'
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -33,4 +33,4 @@ EOF
$t/exe | grep -q 'Hello world'
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -31,4 +31,4 @@ EOF
$t/exe | grep -q 'Hello world'
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -57,4 +57,4 @@ EOF
$t/exe | grep -q 'Hello world'
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -54,4 +54,4 @@ EOF
$t/exe | grep -q 'Hello world'
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -53,4 +53,4 @@ EOF
$t/exe | grep -q 'Hello world'
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -50,4 +50,4 @@ EOF
$t/exe | grep -q 'Hello world'
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -44,4 +44,4 @@ EOF
$t/exe | grep -q 'Hello world'
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -39,4 +39,4 @@ EOF
$t/exe | grep -q 'Hello world'
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -36,4 +36,4 @@ EOF
$t/exe | grep -q 'Hello world'
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -13,4 +13,4 @@ EOF
../mold -o $t/exe $t/a.o
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -14,4 +14,4 @@ EOF
! ../mold -o $t/exe $t/a.o 2> $t/log
grep -q 'undefined symbol: .*\.o: foo' $t/log
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -41,4 +41,4 @@ readelf --segments $t/exe | fgrep -q '
02 .note.baz .note.foo
'
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -41,4 +41,4 @@ EOF
$t/exe | grep -q 'Hello world'
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -58,4 +58,4 @@ Disassembly of section .plt:
20101b: e9 e0 ff ff ff jmpq 201000 <_IO_stdin_used+0xb80>
"
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -50,4 +50,4 @@ rm -f $t/exe
$t/exe | grep -q 'Hello world'
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -14,4 +14,4 @@ EOF
! ../mold -e foo -static -o $t/exe $t/a.o 2> $t/log
fgrep -q 'relocation R_X86_64_16 against foo out of range' $t/log
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -44,4 +44,4 @@ EOF
clang -o $t/exe $t/a.o $t/b.so -nostdlib -pie
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -11,4 +11,4 @@ echo "-o $t/exe '$t/a.o' $t/b.o" > $t/rsp
objdump -d $t/exe > /dev/null
file $t/exe | grep -q ELF
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -18,4 +18,4 @@ readelf --dynamic $t/exe | grep -q "
0x000000000000001d (RUNPATH) Library runpath: [/bar]
"
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -44,4 +44,4 @@ fgrep -q static-archive/c.o $t/log
$t/exe | grep -q '8'
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -46,4 +46,4 @@ Symbol table '.symtab' contains 21 entries:
20: 0000000000202168 0 NOTYPE GLOBAL HIDDEN 8 _edata
"
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -44,4 +44,4 @@ fgrep -q thin-archive/c.o $t/log
$t/exe | grep -q '8'
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -54,4 +54,4 @@ $t/exe | grep -q '3 5 3 5'
$t/exe | grep -q '3 5 3 5'
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -54,4 +54,4 @@ $t/exe | grep -q '3 5 3 5'
$t/exe | grep -q '3 5 3 5'
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -40,4 +40,4 @@ EOF
$t/exe | grep -q '3 5 3 5'
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -39,4 +39,4 @@ EOF
$t/exe | grep -q '3 5 3 5'
echo ' OK'
echo OK

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
echo -n "Testing $(basename -s .sh $0) ..."
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
@ -15,4 +15,4 @@ EOF
../mold -o $t/exe $t/a.o
readelf -a $t/exe > /dev/null
echo ' OK'
echo OK