serenity/Tests/LibELF/TestWeakSymbolResolution.cpp
Dan Klishch bdfc77b725 LibELF: Treat STB_WEAK like STB_GLOBAL during global symbol lookup
This is what POSIX mandates and this also matches the behavior of modern
Linux.
2024-04-21 13:34:04 -06:00

16 lines
259 B
C++

/*
* Copyright (c) 2024, Dan Klishch <danilklishch@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibTest/TestCase.h>
int f();
[[gnu::weak]] int f() { return 1; }
int g();
TEST_CASE(weak_symbol_resolution)
{
EXPECT_EQ(g(), 1);
}