This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: the setrlimit changes in glibc 2.1.3


On Wed, 12 Jan 2000, Geoff Keating wrote:

> So how did the shared lib get a reference to an unversioned setrlimit?
> Was it linked with glibc 2.0?

In glibc 2.1.2 the setrlimit was not versioned. For unversioned references
the linker assumes GLIBC_2.0. Which in this case is not correct.

> I suspect it was not linked with any libc at all, which would be the
> problem.

It was linked against libc (glibc 2.1.2). The test case is attached.

Install glibc 2.1.2 (before the setrlimit changes), do a "make libfoo.so",
then upgrade to the current glibc and in the same directory do a "make
test". The link will fail.

Cristian
--
----------------------------------------------------------------------
Cristian Gafton     --     gafton@redhat.com      --     Red Hat, Inc.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  "How could this be a problem in a country where we have Intel and 
   Microsoft?"  --Al Gore on Y2K

CFLAGS	= -Wall -g
CC	= gcc

all: 

libfoo.so: foo.c
	$(CC) -o $@ -shared -fPIC $< -lc

test: test.c
	$(CC) -o $@ $(CFLAGS) $< -Wl,-rpath,$(shell pwd) -L. -lfoo

clean:
	rm -f test libfoo.so *~ *.o

extern void foo(void);

int main(void)
{
    foo();
    return 0;
}
#include <sys/time.h>
#include <sys/resource.h>
#include <unistd.h>

void foo(void)
{
    setrlimit(RLIMIT_CPU, NULL);
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]