To optimize out calls to undefined functions in PBL at compile-time instead of link time, let's define stubs for the functions that are referenced in obj-pbl-y files, but inside function sections that are ultimately unreferenced. Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx> --- include/memory.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/memory.h b/include/memory.h index 571effd3b0d6..8c330e65c012 100644 --- a/include/memory.h +++ b/include/memory.h @@ -63,8 +63,18 @@ static inline u64 memory_sdram_size(unsigned int cols, void register_barebox_area(resource_size_t start, resource_size_t size); +#if IN_PROPER struct resource *request_barebox_region(const char *name, resource_size_t start, resource_size_t size); +#else +static inline struct resource *request_barebox_region(const char *name, + resource_size_t start, + resource_size_t size) +{ + + return ERR_PTR(-ENOSYS); +} +#endif #endif -- 2.39.5