line numbers and cc

Mark Sherman mss+ at andrew.cmu.edu
Wed Nov 21 01:48:20 AEST 1990


When I compile and build a program with cc on a Mac IIci with AU/X 2.0,
I get a series of messages of the form:

	ld: line nbr entry (2328 0) found for non-relocatable symbol: section
.text, file libfoo.a

I understand this to mean that somehow a symbol is marked as absolute
when it should be relocatable (in particular, the symbol represents a
source line number which I assume gets mapped when the file is loaded).
After much experimentation, it appears that the problem is the existence
of a line number directive in the source code (the C program being
compiled is generated by another program that inserts line number
directives that correspond to the original source). I was able to solve
the problem by removing all of the line number directives in the
procedure that contained the address "2328". None of the line number
directives looked different than the others, and not all directives
caused the problem. I was not able to have "nm -f" show me anything
about line numbers -- I just guessed where the problem was by looking
where 2328 was bracketed (2328 never appeared in the output of nm). Has
anyone else seen this problem before or have a solution (short of
eliminating line number directives in the generated source)? If it
helps, the generated source contains lots of nested blocks -- could some
combination of line number directives and begin/end block markers cause
confusion in the loader? This problem cropped up when I converted to 2.0
from 1.1.1.
		-Mark



More information about the Comp.unix.aux mailing list