Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
rui314 committed Feb 1, 2024
1 parent 7f8d77d commit ba67c5d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
3 changes: 0 additions & 3 deletions elf/mold.h
Original file line number Diff line number Diff line change
Expand Up @@ -2727,9 +2727,6 @@ inline bool Symbol<E>::has_plt(Context<E> &ctx) const {

template <typename E>
inline bool Symbol<E>::is_absolute() const {
if (file && file->is_dso)
return esym().is_abs();

return !is_imported && !get_frag() && !get_input_section() &&
!get_output_section();
}
Expand Down
11 changes: 8 additions & 3 deletions test/elf/shared-abs-sym.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ int main() { printf("foo=%p\n", &foo); }
EOF

$CC -fPIC -c -o $t/d.o $t/c.c
$CC -B. -o $t/exe1 -pie $t/d.o $t/b.so
$QEMU $t/exe1 | grep -q 'foo=0x3'

$CC -B. -o $t/exe2 -no-pie $t/d.o $t/b.so
# This test fails with older glibc
$CC -o $t/exe1 $t/d.o $t/b.so 2> /dev/null || skip
$QEMU $t/exe1 | grep -q 'foo=0x3' || skip

$CC -B. -o $t/exe2 -pie $t/d.o $t/b.so
$QEMU $t/exe2 | grep -q 'foo=0x3'

$CC -B. -o $t/exe3 -no-pie $t/d.o $t/b.so
$QEMU $t/exe3 | grep -q 'foo=0x3'

0 comments on commit ba67c5d

Please sign in to comment.